Copied to clipboard

Flag this post as spam?

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


  • Bex 444 posts 555 karma points
    May 27, 2014 @ 11:10
    Bex
    0

    URL rewriting to remove multiple slashes

    Hi

    I'm sorry if this is the wrong forum but I'm unsure if this is something built in to Umbraco or something that needs extending by c#.

    I have an umbraco v6.1.2 installation and our client has noticed that

    www.mywebsite.com///////page1.aspx

    will resolve exactly the same as

    www.mywebsite.com/page1.aspx

    and it is effecting their SEO

    Is this something that can be solved with Umbraco URL rewriting (if so how?) or is there something else we need to do?

    Any help would be greatly appreciated as we're a bit lost.

    Thanks

    Bex

    0

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    May 27, 2014 @ 21:55
    Jeavon Leopold
    0

    Hi Bex,

    It is a bit strange, do you know how URLs are being indexed or found that have the multiple slashes in them?

    I'm pretty sure it could be solved with a IIS Url Rewriting rule (I will check tomorrow) but it's important to find the source of the links too.

    Jeavon

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    May 28, 2014 @ 11:44
    Jeavon Leopold
    0

    Hi Bex,

    Using IIS Url Rewrite I'm sure this can be done, it's a matter of finding the right regex. I found this rule that removes double slashes:

    <rewrite>
      <rules>
        <rule name="RemoveDoubleSlash" patternSyntax="ECMAScript" stopProcessing="true">
          <match url="(.*)" />
          <action type="Redirect" url="{C:1}/{C:2}" />
          <conditions>
            <add input="{UNENCODED_URL}" pattern="(.*)//(.*)" />
          </conditions>
        </rule>
      </rules>
    </rewrite>
    

    Jeavon

  • Bex 444 posts 555 karma points
    Jun 02, 2014 @ 10:42
    Bex
    0

    Hi Jeavon

    Sorry for the delay. Not been able to get near a computer...!!

    We only found they had multiple slashes as our clients SEO people told us. We are re-writing the URLS ourselves already, but assumed someone must be typing them in, but will check again that we aren't causing it.. I tried this on the site with a double slash as a test and got a redirect loop, but tried it on a normal umbraco site with no url re-writing and it didn't do anything at all!

    Have you tried this on an umbraco site?

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 02, 2014 @ 11:01
    Jeavon Leopold
    0

    Hi Bex,

    Yes I did try it out on a Umbraco site and it worked, but I didn't have any other rewriting going on.

    If the links are not being found or indexed with the multiple slashes I don't believe that this is a SEO issue (but that's only my opinion)....

    Jeavon

  • Bex 444 posts 555 karma points
    Jun 02, 2014 @ 11:09
    Bex
    0

    Thanks Jeavon, I'll have another go with the re-writing on the site, would be good to get it working either way for future reference.

    The links are being found with or without multiple slashes. They resolve the same (try https://www.google.co.uk/////////////////////////////////#q=test). Apparently it's messing up their SEO analysis stuff when it happens though so they want it fixed! We have never ever had anyone have a problem with it before though.. (so either noone's bothered/noticed it happen before, or we're causing it)

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 02, 2014 @ 11:14
    Jeavon Leopold
    0

    It's only a problem if inbound links are being found from somewhere with the multiple slashes in it, if they are not, then I don't see any reason why they ever would.

    Might be interesting to have a rewrite rule to deal with it anyhow!

Please Sign in or register to post replies

Write your reply to:

Draft