Disable URL rewriting for specific URLs
There comes a time when you need to prohibit URL rewriting for specific URLs within your EPiServer CMS website. For example, I've implemented an ashx handler that is used to deliver vCard files on our company's web site.
If I would insert a regular hyperlink to this handler on a page it would link to the current page, not the handler file. Basically, EPiServer doesn't have a way of rewriting this URL.
In order to make EPiServer CMS ignore this specific file or URL when performing URL rewriting we have to add the following to the application's start event:
protected void Application_Start(Object sender, EventArgs e)
{
FriendlyUrlRewriteProvider.UnTouchedPaths.Add(
"/Modules/vCard.ashx");
}
Now I'm able to successfully link to the ashx handler without URL rewriting interfering.
Note: The FriendlyUrlRewriteProvider class is part of the EPiServer.Web namespace.
17 January 2008