Copied to clipboard

Flag this post as spam?

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


  • Frederik T 242 posts 373 karma points
    Nov 24, 2011 @ 14:25
    Frederik T
    0

    SEO and URL's. Need some advice.

    So, the company i work for has hired a SEO consultant firm for the current project. One among many of the things we needed to change and/or optimize was the url's. We have made a sub-page for a special promotion running right now, and that of course needs to be high up on the results list. But it's URL is apparently causing problems. We made it so it has an easy url (for print-outs etc):

    www.oursite.com/promotion

    But according to the SEO consultant, the page can be accessed both through www.oursite.com/promotion AND www.oursite.com/promotion.aspx (note the aspx). Their explanation is that Google treats that as two seperate sites even though they are practically the same.

    Is it possible to somehow make the aspx url inaccessible? Or something else?

    Hope my explanation is understandable.

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Nov 24, 2011 @ 14:32
    Stefan Kip
    1

    Yes, you could rewrite .aspx pages to directory-url's:

    <!-- SEO: Using Directory URLs, so force trim all .aspx -->
    <!-- exclude umbraco folder -->
    <rule name="Trim aspx for directory URLs" stopProcessing="true">
     <match url="(.*)\.aspx$" />
     <conditions>
      <add input="{REQUEST_URI}" pattern="^/umbraco/" negate="true" />
     </conditions>
     <action type="Redirect" redirectType="Permanent" url="{R:1}" />
    </rule>

    Found here: http://umbraco.miketaylor.eu/2010/11/03/url-rewriting-and-seo/

  • Frederik T 242 posts 373 karma points
    Nov 24, 2011 @ 15:06
    Frederik T
    0

    Thanks for the quick reply. If i understand what is written in that link, that removes .aspx from ALL pages? we might do that in the future but many of our templates and macros rely on hotlinking so if .aspx was removed they had to be changed (which is quite a lot of work). Can i remove it for JUST that one page?

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Nov 24, 2011 @ 16:39
    Stefan Kip
    0

    What do you mean with templates and macros relying on hotlinking?
    This UrlRewrite will redirect the request for "/somefolder/somedirectory.aspx" to "/somefolder/somedirectory", nothing will break or result in a 404.

    If you really want to include your promotion page only, use this:

    <rule name="Trim aspx from promotion page for directory URLs" stopProcessing="true">
     <match url="(promotion)\.aspx$" />
     <conditions>
      <add input="{REQUEST_URI}" pattern="^/umbraco/" negate="true" />
     </conditions>
     <action type="Redirect" redirectType="Permanent" url="{R:1}" />
    </rule>
  • Frederik T 242 posts 373 karma points
    Nov 25, 2011 @ 10:53
    Frederik T
    0

    Thanks man, just what i needed :) i will also try and implement the code from the link you gave me later, as it looks like the best overall solution.

    I meant that some of the xslt files etc. links directly to some of the pages, as in not use node id's for example, and instead www.something.com/something.aspx. But if that wont be a problem even after the changes to the web.config then i wouldnt have to worry.

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Nov 25, 2011 @ 11:03
    Stefan Kip
    0

    Exactly, all your existing .aspx links will work, as in they will redirect to the non-.aspx link (directory url) :-)

  • Frederik T 242 posts 373 karma points
    Nov 25, 2011 @ 11:16
    Frederik T
    0

    Awesome! Thanks!

  • dillorscroft 198 posts 192 karma points
    Nov 25, 2011 @ 11:53
    dillorscroft
    0

    Hi,


    The correct way of doing this should not be at a url rewriting level;   Google wants you to use a specific tag called canonical.

    If you add this in between the head tags.

     <link rel="canonical" href="http://www.oursite.com/promotion"/>

    It will not matter to google that the other .aspx is accessible as it will treat the above link as the main page, ignoring all duplicates.. 

    http://www.google.com/support/webmasters/bin/answer.py?answer=139394 


    DC 

  • Richard Soeteman 4049 posts 12922 karma points MVP 2x
    Nov 25, 2011 @ 12:02
    Richard Soeteman
    0

    Matt Cutts tells a different story http://www.youtube.com/watch?v=zW5UL3lzBOA

  • Anthony Candaele 1197 posts 2049 karma points
    Nov 26, 2011 @ 17:19
    Anthony Candaele
    0

    @kipusoep I added as you suggested this to my web.config file

    <!-- SEO: Using Directory URLs, so force trim all .aspx -->
        <!-- exclude umbraco folder -->
        <rule name="Trim aspx for directory URLs" stopProcessing="true">
        <match url="(.*)\.aspx$" />
        <conditions>
        <add input="{REQUEST_URI}" pattern="^/umbraco/" negate="true" />
        </conditions>
        <action type="Redirect" redirectType="Permanent" url="{R:1}" />
        </rule>

    But then going to my website results in a 505 error pages.

    Is there anything else I should configure?

    greetings,

    Anthony

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Nov 26, 2011 @ 22:21
    Jeavon Leopold
    0

    You need to add the rule to urlrewritting.config inside the config folder not web.config, that is probably your issue :-)

    Check out http://www.urlrewriting.net/160/en/documentation.html for more info about rules you can add to urlrewritting.config

  • Anthony Candaele 1197 posts 2049 karma points
    Nov 27, 2011 @ 10:12
    Anthony Candaele
    0

    Hi Jeavon,

    No, the <urlrewriting> element in the urlrewriting.config file doesn't have a <rule> element. It should be in the web.config file alright. I got this information from Scott Gutthrie blog: http://weblogs.asp.net/scottgu/archive/2010/04/20/tip-trick-fix-common-seo-problems-using-the-url-rewrite-extension.aspx

    My problem was that I didn't have url redirect extensions installed on my webserver (IIS 7.5)

    After following the instructions on Scott's blog, everything is working fine. The rule for redirecting url's with /default was added, as wel as kipusoup's rule for url's with a file extionsion. My rules in my web.config file now look like this:

    <rewrite>

    <rules>

                    <rule name="Default Document URL Rewrite" stopProcessing="true">

                        <match url="(.*?)/?Default\.aspx$" />

                        <action type="Redirect" url="{R:1}/" />

                    </rule>ยต

                    <!-- SEO: Using Directory URLs, so force trim all .aspx -->

                    <!-- exclude umbraco folder -->

                    <rule name="Trim aspx for directory URLs" stopProcessing="true">

                    <match url="(.*)\.aspx$" />

                    <conditions>

                    <add input="{REQUEST_URI}" pattern="^/umbraco/" negate="true" />

                    </conditions>

                    <action type="Redirect" redirectType="Permanent" url="{R:1}" />

                    </rule>

                </rules>

            </rewrite>

    The only rule I want to add still is a rule for case-sensitive url's so that for instance a url like

    www.webmove.be/Diensten

    will be redirected to www.webmove.be/diensten

    Any help would be greatly appreciated

    greetings,

    Anthony

  • Anthony Candaele 1197 posts 2049 karma points
    Nov 27, 2011 @ 10:26
    Anthony Candaele
    0

    ok, I should have read Scott's blog post 't ill the end, there is also a rule for case-sensitive url's:

    <rule name="LowerCaseRule1" stopProcessing="true">

                        <match url="[A-Z]" ignoreCase="false" />

                        <action type="Redirect" url="{ToLower:{URL}}" />

                    </rule>

    greetings,

    Anthony

  • Frederik T 242 posts 373 karma points
    Dec 15, 2011 @ 13:21
    Frederik T
    0

    Ok, so a little update and hopefully some help (i hope that the topic marked "solved" wont scare people away).

     

    I ended up putting this in UrlRewriting.config which was a much easier solution:

    <add name="SEO | Trim .aspx for directory URLs"
             redirect="Application"
             redirectMode="Permanent"
             virtualUrl="^/(?![0-9]+.aspx)(?!umbraco/)(.*).aspx$"
             rewriteUrlParameter="ExcludeFromClientQueryString"
             destinationUrl="/$1/"
             ignoreCase="true" />

    But, here is a crazy question: how do i FORCE .aspx at the end of url's instead of removing them? as in redirecting "www.mysite.com/somepage/" to "www.mysite.com/somepage.aspx" instead of the other way around like most would?

  • Frederik T 242 posts 373 karma points
    Dec 21, 2011 @ 12:40
    Frederik T
    0

    Sorry for bump, but i woulder rather do this than create a redundant thread.

    Also, im not good with regex so bear with me, how do i redirect any ".asp" requests? because before we moved to umbraco the old site used .asp pages, but google still remember them and it hurts the pagerank because there are so many pages that google still try to find.

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Aug 06, 2013 @ 09:29
    Stefan Kip
    0

    Btw, I'm using these rules:

    <!-- SEO rules (from: http://www.seomoz.org/blog/what-every-seo-should-know-about-iis#chaining) -->
    <!-- SEO | Section 1 | Whitelist -->
    <rule name="Whitelist - Resources" stopProcessing="true">
      <match url="^(?:css/|scripts/|images/|install/|config/|umbraco/|umbraco_client/|base/|services/|webresource\.axd|scriptresource\.axd)"/>
      <conditions logicalGrouping="MatchAll" trackAllCaptures="false"/>
      <action type="None"/>
    </rule>
    <!-- SEO | Section 2 | Rewrites (chaining) -->
    <rule name="SEO - Remove default.aspx" stopProcessing="false">
      <match url="(.*?)/?default\.aspx$"/>
      <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="{HTTP_METHOD}" pattern="GET"/>
      </conditions>
      <action type="Rewrite" url="_{R:1}"/>
    </rule>
    <rule name="SEO - Remove trailing slash" stopProcessing="false">
      <match url="(.+)/$"/>
      <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="{HTTP_METHOD}" pattern="GET"/>
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
      </conditions>
      <action type="Rewrite" url="_{R:1}"/>
    </rule>
    <rule name="SEO - Lower case" stopProcessing="false">
      <match url="(.*)" ignoreCase="false"/>
      <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="{HTTP_METHOD}" pattern="GET"/>
        <add input="{R:1}" pattern="[A-Z]" ignoreCase="false"/>
      </conditions>
      <action type="Rewrite" url="_{ToLower:{R:1}}"/>
    </rule>
    <!-- SEO | Section 3 | Redirecting -->
    <rule name="SEO - HTTP canonical redirect" stopProcessing="true">
      <match url="^(_*)(.*)"/>
      <conditions logicalGrouping="MatchAll" trackAllCaptures="true">
        <add input="{HTTP_HOST}" pattern="^www\.(.*)"/>
        <add input="{HTTP_METHOD}" pattern="GET"/>
        <add input="{SERVER_PORT}" pattern="80"/>
      </conditions>
      <action type="Redirect" url="http://{C:1}/{R:2}"/>
    </rule>
    <rule name="SEO - HTTPS canonical redirect" stopProcessing="true">
      <match url="^(_*)(.*)"/>
      <conditions logicalGrouping="MatchAll" trackAllCaptures="true">
        <add input="{HTTP_HOST}" pattern="^www\.(.*)"/>
        <add input="{HTTP_METHOD}" pattern="GET"/>
        <add input="{SERVER_PORT}" pattern="443"/>
      </conditions>
      <action type="Redirect" url="http://{C:1}/{R:2}"/>
    </rule>
    <rule name="SEO - Non-canonical redirect" stopProcessing="true">
      <match url="^(_+)(.*)"/>
      <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="{HTTP_METHOD}" pattern="GET"/>
      </conditions>
      <action type="Redirect" url="{R:2}"/>
    </rule>
    <!-- // SEO rules -->
    
Please Sign in or register to post replies

Write your reply to:

Draft