Duplicate Content aka 301 redirect from .com to .com/index.html
-
Moz reports are telling me that I have duplicate content on the home page because .com and .com/index.html are being seen as two pages. I have implemented 301 redirect using various codes I found online, but nothing seems to work. Currently I'm using this code.
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^jacksonvilleacservice.com
RewriteRule ^index.html$ http://www.jacksonvilleacservice.com/ [L,R=301]Nothing is changing. What am I doing wrong? I have given it several weeks but report stays the same. Also according to webmasters tools they can't see this as duplicate content. What am I doing wrong?
-
Thank you very much. I have implemented your suggestions and we'll see how it goes. Thanks again.
-
All of the answers here have pretty much outlined what you should do in this situation, but I thought I'd sum it all up here:
-
You probably don't need to redirect /index.html to www.jacksonvilleacservice.com of the website for the homepage, since it can be tricky. Instead, make sure that:
-
All internal links pointing to the homepage go to ttp://www.jacksonvilleacservice.com rather than the /index.html page
-
The homepage canonicals to the www.jacksonvilleacservice.com with_out_ the /index.html
-
If you want to be doubly sure, you can use the code Doug provided.
-
Other commenters have also noticed, a potentially bigger issue is that you're creating two copies of your site by allowing visitors to reach your site with or without a "www" before the URL. For that you will need to create a 301 redirect, and you should canonical to be doubly sure.
Good luck!
-
-
My preference tends to be to redirect such pages to the domain rather than the other way round. You'll find that people naturally link to the domain (without the path) so making that the canonical version makes sense. It also means that you can future-proof your site somewhat. (What happens when your change the content management system and instead of an index.html for your home page, you've not got an index.php page...)
So, my recommendation would be to make sure that all internal links to the home page on your own site point to http://www.jacksonvilleacservice.com/ and set up a redirect from the index.html to the domain.
Then you'd use something like the following to redirect the index.html to the main page:
RewriteCond %{THE_REQUEST} ^./index.html
RewriteRule ^(.)index.html$ http://www.example.com/$1 [R=301,L]Another tool to check your headers and that your redirects are in place is: http://web-sniffer.net/
It also appears that you've got a problem with both the www and non-www versions of the page responsing with a 200 response code.
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]If you look at your inbound links using Open Site Explorer, you'll see that you've got a mix of links pointing to either http://www.jacksonvilleacservice.com/ or http://jacksonvilleacservice.com/.
(There don't appear to be any external links show in OSE linking to your /index.html page)
-
Ok, first thing let’s not reply on report only and check some online 301 redirection checker to see if your redirection code is working or not! Here is a tool by SEObook that allows you to check the header status of any URL http://tools.seobook.com/server-header-checker/
Redirection code is very much depends upon what website are you using like PHP, wordpress, ASP or anything else the redirection code will be different as PHP and ASP are different languages and for WP there are tons of plugins that can do your work!
My advice would be to search for “how to redirect (website’s language)” and I am sure there will be some articles that have explained the step by step process. Hope this helps!
Hope this helps!
-
A 301 redirect for this can be tricky, as the other responses have said in this thread, it can create an infinite redirect loop. I'm pretty sure it can be done, but I don't have enough technical know-how to tell you what's wrong with your conf code there.
A simple way around this is to put a rel=canonical tag in the of your home page, pointing at your root directory (i.e. "/"). You can include this in the in the file, so it'll show up when the page is accessed under both / and for /index.html. The HTML for this would look like: . Make sure your internal links point to the canonical version, as this method may lose you a little pagerank (pagerank coming from /index.html to /).
You have a canonicalization problem for your subdomain too... meaning you're serving the same content for both http://www.jacksonvilleacservice.com (with www) and http://jacksonvilleacservice.com (without www). I'd pick one, and then do 301 redirects from one to the other, rather than solving that issue with canonical tags.
-
I agree with Eric it would be a good idea to link to your root domain and not the specific file. You can just link to yourdomain.com or build your links to your homepage using code similar to the following: Home.
I have also seen instances where yourdomain.com and www.yourdomain.com are treated as separate pages and cause similar problems. It appears you are using www.yourdomain.com so while you are messing with 301 redirects you might want to add one from yourdomain.com to www.yourdomain.com for all URLs in case a link is made to yourdomain.com.
-
Since index.html is most likely your home page (it's the default home page on your web server), then you really don't need to set up a 301 Permanent Redirect in this situation. The only thing you need to do is make sure that on your website you don't have any links pointing to www.yourdomain.com/index.html. Rather, all of those links should be pointing to www.yourdomain.com as the home page.
If you set up a redirect from index.html to your site's home page www.domain.com then you'll probably create a "loop" that won't work. If you find all the links to /index.html and fix those then that will be enough to take care of this.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Update old article or publish new content and redirect old post?
Hi all, I'm targetting a keyword and we used to rank quite good for it. Last couple of months traffic of that keyword (and variations) is going down a bit. I wrote an extensive new post on the same topic, much more in dept and from 600 to 1800 words covering the same topic. Is it better to update the old article and mention that it's updated recently, or publish a new post and redirect the old post to the new post?
On-Page Optimization | | jorisbrabants0 -
How long should I leave an existing web page up after a 301 redirect?
I've been reading through a few of blog posts here on moz and can't seem to find the answer to these two questions: How long should I leave an existing page up after a 301 redirect? The page old page is no longer needed but has pretty high page authority. If I take the old page down—the one that I'm redirecting from—immediately after I set up the 301 redirect, will link juice still be passed to the new page? My second question is, right now, on my index.html page I have both a 301 redirect and a rel canonical tag in the head. They were both put in place to redirect and pass link equity respectively. I did this a couple years back after someone recommended that I do both just to be safe, but from what I've gathered reading the articles here on moz is that your supposed to pick one or the other depending on whether or not it's permanent. Should I remove the rel conanical tag or would it be better to just leave it be?
On-Page Optimization | | ScottMcPherson0 -
Does this site have a duplicate content issue?
Google WMT is showing me only 2 short meta descriptions under "HTML Improvements" but I believe http://www.customgia.com may have a content duplication issue. Numerous keywords are used repeatedly across many product descriptions. To make matters worse, every product page has a "Design It!" button that sends the user to a flash-based jewelry designer in which they can edit the product's appearance. I'm not sure if these "designer pages" are adding unnecessary and potentially damaging duplicate content but it's certainly a possibility. There are many items on this site that are similar to one another but not the same. The product description tend to use the same phrases over and over again - words like crystal, Swarovski, beaded, design it, customize, change, pearl, glass beads, iridescent, pearl, drop earrings are used a lot. What I'm stuck on is whether or not I should be focusing on a content duplication issue as the primary SEO problem or if there is something bigger. Thank you for any assistance you can provide!
On-Page Optimization | | rja2140 -
How to check duplicate content with other website?
Hello, I guest that my website may be duplicate contents with other websites. Is this a important factor on SEO? and how to check and fix them? Thanks,
On-Page Optimization | | JohnHuynh1 -
Duplicate Page Titles and Duplicate Content
I've been a Pro Member for nearly a year and I am bound and determined to finally clean up all the crawl errors on our site PracticeRange.com. We have 180 errors for Duplicate Page Titles and Duplicate Content. I fixed many of the pages that were product pages with duplicate content. Those product descriptions were edited and now have unique content. However, there remain plenty of the errors that are puzzling. Many of the errors reference the same pages, for example, the Home Page, Login Page and the Search page (our catalog pages).
On-Page Optimization | | AlanWills
In the case of the Catalog Page errors, these type pages would have the same title every time "Search" and the results differ according to category. http://www.practicerange.com/Search.aspx?m=6
http://www.practicerange.com/Search.aspx?m=15 If this is rel=canonical issue, how do I fix it on a search result page? I want each of the different category type pages to be indexed. One of them is no more important than the other. So how would I incorporate the rel=canonical? In the case of the Home Page errors, I'm really confused. I don't know where to start to fix these. They are the result of a 404 error that leads to the home page. Is the content of the 404 page the culprit since it contains a link to the home page? Here are examples of the Home Page type of crawl errors. http://www.practicerange.com/404.aspx?aspxerrorpath=/Golf-Training-Aids/Golf-Nets/~/Assets/ProductImages/products/Golf-Training-Aids/Rubber-Wooden-Tee-Holder.aspx http://www.practicerange.com/404.aspx?aspxerrorpath=/Golf-Training-Aids/Golf-Nets/~/Assets/ProductImages/products/Golf-Training-Aid/Impact-Bag.aspx Thanks , Alan WillsPracticeRange.com0 -
How do I do a 301 Redirect in Wordpress
I have several pages that are showing up as "duplicate" on my Wordpress based site based upon the structure of site. I was wondering how to do a 301 redirect for these pages
On-Page Optimization | | SteveSweat0 -
Is rel=canonical used only for duplicate content
Can the rel-canonical be used to tell the search engines which page is "preferred" when there are similar pages? For instance, I have an internal page that Google is showing on the first page of the SERPs that I would prefer the home page be ranked for. Both the home and internal page have been optimized for the same keyword. What is interesting is that the internal page has very few backlinks compared to the home page but Google seems to favor it since the keyword is in the URL. I am afraid a 301 will drop us from the first page of the SERPs.
On-Page Optimization | | surveygizmo0 -
Meta Descriptions - Duplicate Content?
I have created a Meta Description for a page that is optimized for SERPS. If I also put this exact content on my page for my readers, would this be considered duplicate content? The meta description and content will be listed on the same page with the same URL. Thanks for your help.
On-Page Optimization | | tuckjames0