Copied to clipboard

Flag this post as spam?

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


  • Sean L 24 posts 146 karma points
    Apr 07, 2015 @ 23:02
    Sean L
    0

    UrlRewriting rule adding extra text to destination URL

    Environment Info: Umbraco v6.2.1, IIS 7.5, .NET 4.5

    I have created some URL rules to handle some redirection for certain incoming requests. When this rule fires, it is adding extra words/characters to the destinantion URL.

    The situation arose from duplicate information being contained on two different pages, with some unique content. The client wanted to merge the pages to reduce duplicate information, therefore www.mysite.com/about-us/somewhere and www.mysite.com/about-us/otherplace need to redirect to www.mysite.com/about-us/somewhere-otherplace.

    <add name="somewhereMoved" redirectMode="Permanent" redirect="Domain" ignoreCase="true" rewriteUrlParameter="IncludeQueryStringForRewrite" virtualUrl="http://www.mysite.com/about-us/somewhere" destinationUrl="https://www.mysite/about-us/somewhere-otherplace" />

    I created several versions of the rule to account for SSL and non-SSL, as well as with ending slash and no ending slash, so 4 rules for each specific redirect. So, in total, I have eight rules for redirecting 'somewhere' and 'otherplace' to 'somewhere-otherplace.' When I put the rules in place, I am seeing when accessing one of the rules for each (SSL, without slash in testing), that it is adding text to the end of the url during the redirection. For example:

    https://www.mysite.com/about-us/somewhere will redirect to https://www.mysite.com/about-us/somewhere-otherplace-otherplace-otherplace-otherplace-otherplace-otherplace

    What seems strange is this only happens when I create one of the URLs set of rules are in place (somewhere) but not when both sites have rewrite rules ('somewhere' as well as 'otherplace'). Also, as noted before, no other rules have any issues. Everything has worked perfectly up to this point.

    What am I missing? Has anyone ever seen where a rule would add text to the destination url?

    Thanks in advance!

    Please note, I am sure there is a cleaner approach to the rules instead of having near duplicates for each instance, but this works with current rules that are implemented with no problem. I don't have a ton of experience with URL rewriting, so suggestions are welcome!

    Another note is that the client has two domains. IIS contains a rule to push all traffic from http://www.otherurl.com to https://www.mysite.com. There are no other rules contained within IIS.

     

     

     

     

     

     

Please Sign in or register to post replies

Write your reply to:

Draft