Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Danny 12 posts 82 karma points
    Oct 07, 2013 @ 12:15
    Danny
    0

    UrlReWrite Help...

    Hey guys,

    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?

  • Dallas 133 posts 405 karma points
    Oct 09, 2013 @ 18:57
    Dallas
    100

    Hi Danny

    The string matching on the virtualUrl is done with a regular expression. The wildcard ( *.pdf ) will not match any of the pdf files in the directory.

    Off the top of my head the regular expression would be

    virtualUrl="~/oldpdfs/(.*)\.pdf"

    This will match any combination of characters before the .pdf extension.

    Dallas

Please Sign in or register to post replies

Write your reply to:

Draft