I use urlRewriting to capture basically any page error and send the requester to my error page. At this point I am not checking for a 404 or a 403, etc. Just if an error occurs I send them to a desired page.
Here is what I have setup.
In the ConfigSection, in the web.config I have the following code:
In the configsection in the web.config I have this code.
<!--
1st UrlRewritingNet.UrlRewrite entry -->section name="urlrewritingnet" requirePermission ="false" type="UrlRewritingNet.Configuration.UrlRewriteSection, UrlRewritingNet.UrlRewriter" />
I then have my own section that handles 403s and errors.
<!-- 2nd UrlRewritingNet.UrlRewrite entry -->
<urlrewritingnet
rewriteOnlyVirtualUrls="true"
contextItemsPrefix="QueryString"
defaultPage = "default.aspx"
defaultProvider="RegEx"
xmlns="http://www.urlrewriting.net/schemas/config/2006/07" >
<rewrites>
<add name="KickItHSCOM" virtualUrl="^http\://hilbertsolutions.com/(.*).aspx"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="http://www.hilbertsolutions.com/$1.aspx"
redirect="Domain"
redirectMode="Permanent"
ignoreCase="true" />
<add name="KickItHSNET" virtualUrl="^http\://hilbertsolutions.net/(.*).aspx"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="http://www.hilbertsolutions.com/$1.aspx"
redirect="Domain"
redirectMode="Permanent"
ignoreCase="true" />
<add name="KickItWWWHSNET" virtualUrl="^http\://www.hilbertsolutions.net/(.*).aspx"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="http://www.hilbertsolutions.com/$1.aspx"
redirect="Domain"
redirectMode="Permanent"
ignoreCase="true" />
</rewrites>
</urlrewritingnet>
Finally, I have this config section in httpmodules.
<!--
<
3rd UrlRewritingNet.UrlRewrite entry -->add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
I placed the urlrewiritng.neturlrewriter.dll in my bin folder.
I hope that helps. I am going off of memory here so I can't be 100% sure.
Stuart
<