This project is read-only.

Rewrite Rule causing unfriendly 404 Errors

Dec 10, 2012 at 6:54 PM

Enabling the Contrib.RewriteRule doesn't allow for the friendly 404 errors that Orhcard displays.  When the module is disabled everything works fine with most of the widgets being built just fine and putting a friendly 404 shape where the content would be.  Once in enabled the 404 becomes the all white page with black letters.

I tried to debug through this several times to see where it goes wrong.  It hits the HomeController in the Contrib.RewriteRule to throw the HttpNotFoundResult() which seems to be as expected.  It than continues on UnhandledExcpetionFilter as expected and creates the model with the NotFound method form Orchard Services.

I haven't been able to find any difference outside hitting the HomeController with the process in the debugger.  I saw there was already a thread for this but thought maybe I would start a new one.

Dec 11, 2012 at 8:27 AM

Ok found the solution in the issue tracker.  Simply need to add the theme attribute to the HomeController as follows

 

public class HomeController : Controller {
        [Themed]
        public ActionResult Rewrite(string path) {
            return new HttpNotFoundResult();
        }
    }