The Moz Q&A Community

Hey friend! Have fun exploring Q&A, but in order to ask your own
questions, comment, or give thumbs up, you need to be logged in to your
Moz Pro account.
You can also earn access by receiving 500
MozPoints
from participating in YouMoz and the Moz Blog!

If you use the rel= canonical tag you will have to do it for all pages with this issue. If the issue is widespread, you can consider a 301, but that wont be very effective for SEO purposes when compared to rel=canonical tag.

A while back I had asked our hosting company to create 301 redirects in the htacces file for the same issue (www.mysite.com/index.html to www.mysite.com, www.mysite.com/products/index.html to www.mysite.com/products/ .....) THe response I received was "redirecting .../index.html to ..../ won’t work. They’re the same page. Apache will get in an infinite loop and the page won’t load. "

Any help would be greatly appreciated since I have 36 instances of this happening on our site.

This is an older thread, and people may not see the new response if they're not subscribed to it.

You can certainly redirect the index.html to /. The above thread gives some help, as well as http://www.smartlabsoftware.com/howto/redirect-index-page.htm (though I don't know the age of that post and if it's for a current version of Apache).

I suggest opening a new question here with a title something like "redirecting /index.html to / in apache" and give your details in that question, with a link to the above URL and ask if this is still valid. A link to your site in the question, if you can give it, would also be great.

David BrownWeb & Mobile Developer at David Brown Web & Software development

Jul 28, 2011

If you are only talking about your home page, then yes setup a 301 redirect as others have shown for the entries already in googles index BUT a redirect itself can lose up to 10% of any link juice flowing to your index page. And if you're building off site links, do you link to your root domain or the specific URL of your homepage? My guess is the root, i.e. www.mysite.com so unless www.mysite.com is actually a different website to whats found at www.mysite.com/blue/ then I always strive to get my sites working without an initial redirect taking place when someone goes to www.mysite.com

Depending on you choice of webserver, you can specify what the default index page should be, in apache this is known as the 'DirectoryIndex'.

If you add the line

DirectoryIndex /blue/index.html

to your .htaccess (or even better apache site config if you can) then apache will serve that page WITHOUT the redirect ensuring any link juice to your route domain is not diluted.

Then just make sure any links on your own site that point to you home page DO NOT point to /blue/ or /blue/index.html but simply to "/" or "http://www.mysite.com/"

I don't think some of the responses in this thread have given you adequate information to solve your problem. 301's and rel canonical are there to solve two very different problems, and when used correctly, can solve a lot of different SEO problems.

In your example you have two URLs which I am going to assume have the exact same information on them. Classic duplicate content situation. Ideally, I think you would want to delete one of these pages and create a 301 to redirect any users and links to the other page. This will focus all your content and links onto a single page and your PR and rankings will rise. I would choose to keep the page that has the better keywords in the URL, and no, it doesn't matter if you have the .html at the end of the URL. With or without, the actual keywords in the URL are more important.

The use of rel="canonical" has a very different purpose. Say for whatever reason you want to keep both of your URL's even though they have the exact same content (testing conversation rates, for example). In this case you would use a rel="canonical" on the page you don't want to rank in the search engines, pointing to the page you do want to rank for.

On http://www.mysite/blue/index.html for example, you would create this tag: <rel="canonical" href="http://www.mysite/blue/"> eCommerce sites have to do this a lot.

Rel canonical should not be used when you're trying to move content from one URL to another. That's what 301s are for.

Hey friend! Have fun exploring Q&A, but in order to ask your own
questions, comment, or give thumbs up, you need to be logged in to your
Moz Pro account.
You can also earn access by receiving 500
MozPoints
from participating in YouMoz and the Moz Blog!
Learn more.