Search code examples
url-rewritingumbraco

Umbraco UrlReWrite


I wanna setup a URL ReWrite in my Umbraco Setup and after couple of hourse of trial and errors still stucked. Hope I can get a help from you guys here.

I want to urlrewrite so links to older pdf files been redirect to an umbraco page.

I have tried creating the following but it doesnt work, it just return standard IIS 404 page.

<add name="PDFs" virtualUrl="~/oldpdfs/*.pdf" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="/MyCustom404Page.aspx" redirectMode="Permanent" ignoreCase="true" />

Why it's not working for me? Any suggestion?


Solution

  • Perhaps try this:

    <add name="PDFs" virtualUrl="~/oldpdfs/(.*).pdf" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="/MyCustom404Page.aspx" redirectMode="Permanent" ignoreCase="true" />