Rewrite and 404 redirect

Nov 25, 2011 at 7:29 AM

I had enabled custom errors in the web.config to redirect to a page I created as a content (ex : /pagenotfound).

But since I  activated the rewrite module, the urls that don't exist returns a 404 Server Error.

Nov 8, 2012 at 4:59 PM

Has anyone figured out a fix for this?   The behavior I'm seeing is that with the Rewrite Rules module enabled, I don't get the friendly Orchard 404 page, instead I get the IIS 404 page which is very stark.

Nov 10, 2012 at 7:42 PM

I see this same behavior. Does anyone have an idea how to resolve this?

Dec 11, 2012 at 7:28 AM

Saw a solution in the issue tracker here.  Adding the theme attribute to the HomeController RewriteAction fixes the issue.

 

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

Jul 26, 2013 at 10:34 AM
Edited Jul 26, 2013 at 11:12 AM
Adding the themed attribute works for the default site in a multi tenancy but does not appear to work for any of the tennants. Does anybody have any ideas?

Problem solved - Bertrand's Vandelay Fail module to the rescue.