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?
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?
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:
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.
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:
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?
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.
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.
Yes, you could rewrite .aspx pages to directory-url's:
Found here: http://umbraco.miketaylor.eu/2010/11/03/url-rewriting-and-seo/
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?
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:
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.
Exactly, all your existing .aspx links will work, as in they will redirect to the non-.aspx link (directory url) :-)
Awesome! Thanks!
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
Matt Cutts tells a different story http://www.youtube.com/watch?v=zW5UL3lzBOA
@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
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
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
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
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?
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.
Btw, I'm using these rules:
is working on a reply...