Copied to clipboard

Flag this post as spam?

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


  • Rasmus Fjord 659 posts 1546 karma points c-trib
    Apr 24, 2015 @ 09:36
    Rasmus Fjord
    0

    Urlrewriting.net creating rule for "/"

    Hey there i wanna create a rule that hits "/" and redirects to "/da/forside" and so far i have a rule that looks like this:

    <add name="Frontpagefix" virtualUrl="~/" destinationUrl="~/da/forside/" redirect="Application" redirectMode="Permanent" ignoreCase="true"/>

     

    But this rule activated when ever something is matching "/" which is every page :)

    Anyone got a good idea?

     

     

     

  • Jesper Hauge 298 posts 486 karma points c-trib
    Apr 24, 2015 @ 09:49
    Jesper Hauge
    1

    As far as I remember UrlRewrite.net uses regex'es for matching, you could probably get away with just adding a line end character search:

    virtualUrl="~/$"
    

    Regards Jesper Hauge

  • Rasmus Fjord 659 posts 1546 karma points c-trib
    Apr 24, 2015 @ 10:03
    Rasmus Fjord
    0

    Your right it uses regex. When i do that it still hits it like this :

    "/da/forside/da/forside/da/forside/da/forside/da/forside/da/forside/da/forside/da/forside/da/forside/da/forside/da/forside/da/forside/da/forside/da/forside/da/forside/da/forside/"

    So its still just hitting it all.

    Ive also tried with virtualUrl="~/^", it dosnt break but isnt hit either.

     

     

     

  • Jesper Hauge 298 posts 486 karma points c-trib
    Apr 24, 2015 @ 10:13
    Jesper Hauge
    0

    You mean it redirects to the string in your answer, that's odd, and everything is ok if you just hit "/da/forside/" from a browser?

    Seems like we got the virtualUrl right, but the redirect is failing in some way.

    How does the response look when virtualUrl="~/$" do you get the expected 301 redirect from the server, and does it really redirect to "/da/forside/da/forside..."?

  • Rasmus Fjord 659 posts 1546 karma points c-trib
    Apr 24, 2015 @ 10:23
    Rasmus Fjord
    0

    It actually breaks everything.

    Because every call goes like this, i hit http://domain.com.

    redirects to /da/forside/

    Redirects to /da/forside~/da/forside

    Redirects to /da/forside~/da/forside~/da/forside

    And so it continues.

  • Rasmus Fjord 659 posts 1546 karma points c-trib
    Apr 24, 2015 @ 10:26
    Rasmus Fjord
    102

    I fixed it with a mix of our tries :) 

      <add name="Frontpagefix" virtualUrl="http://www.domain.dk/$" destinationUrl="http://www.domain.dk/da/forside/" redirect="Domain" redirectMode="Permanent" ignoreCase="true"/>
  • 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