Copied to clipboard

Flag this post as spam?

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


  • Kelsee Ishmael 71 posts 158 karma points
    Jul 13, 2015 @ 23:51
    Kelsee Ishmael
    0

    301 Redirect Issue when using a query string in the virtual url

    I'm trying to put a bunch of 301 redirects in place and I am running into an issue when trying to redirect from a query string. Here is an example of what I am doing:

    <add name="FAQ"
    virtualUrl="/content.aspx?PageID=2610"
    destinationUrl="/public-reporting/frequently-asked-questions/"
    rewriteUrlParameter="IncludeQueryStringForRewrite"
    ignoreCase="true"
    redirect="Domain"
    redirectMode="Permanent" />
    
    <add name="ABOUT"
    virtualUrl="/content.aspx?PageID=3040"
    destinationUrl="/about-acn/"
    rewriteUrlParameter="IncludeQueryStringForRewrite"
    ignoreCase="true"
    redirect="Domain"
    redirectMode="Permanent" />
    

    I've tried switching rewriteUrlParameter between Include and Exclude, but I really don't feel that has anything to do with it. Am I missing a parameter or do I need to add some kind of regex?

    Unfortunately, all of the pages were in the format of "/content.aspx?PageID=1234", so it's possible that the many rewrites are getting confused by the same root page of "content.aspx"?

    Thanks!

  • Kelsee Ishmael 71 posts 158 karma points
    Jul 20, 2015 @ 20:25
    Kelsee Ishmael
    100

    The answer, for those wondering.

    "?" is a reserved character, so you have to escape it. .

    virtualUrl="(\/content\.aspx\?PageID=3040)"
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies