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.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
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
-
How do I fix my portfolio causing duplicate content issues?
Hi, Im new to this whole duplicate content issue. I have a website, fatcatpaperie.com that I use the portofolio feature in Wordpress as my gallery for all my wedding invitations. I have a ton of duplicate content issues from this. I don't understand at all how to fix this. I'd appreciate any help! Below is an example of one duplicate content issue. They have slightly different names, different urls, different images and all have no text. But are coming up as duplicates. Would it be as easy as putting a different metadescription for each?? Thanks for the help! Rena | "Treasure" by Designers Fine Press - Fat Cat Paperie http://fatcatpaperie.com/portfolio-item/treasure-designers-fine-press 1 0 0 0 200 3 duplicates "Perennial" by Designers Fine Press - Fat Cat Paperie http://fatcatpaperie.com/portfolio-item/perennial-by-designers-fine-press 1 0 0 0 200 1 of 3 duplicates "Primrose" by Designers Fine Press - Fat Cat Paperie http://fatcatpaperie.com/portfolio-item/8675 1 0 0 0 200 2 of 3 duplicates "Catalina" by Designers Fine Press - Fat Cat Paperie http://fatcatpaperie.com/portfolio-item/catalina-designers-fine-press |
On-Page Optimization | | HonestSEOStudio0 -
No-index or 301 - custom wordpress archives
Hi, We are using custom wordpresss posts to showcase different services we provide, these are then grouped within custom archives. These custom archive pages are our main keyword landing pages and traffic generators (although ranking is fairly average). It's come to my attention that these custom posts have also been listed in the wordpress standard categories, with an identical title, excerpts and near identical urls as the custom archives. This appears to have been the case for quite a while. We are concerned that this is may causing duplicate content issues and unsure how to proceed. We have been advised to simply no-index the redundant 'standard' categories but as they have been indexed for some time we are cautious of causing any upset with search engines (although the categories are indexed they are not ranking for any major keywords) Are we best 301ing the redundant category to the custom archives or using a canonical tags or simply no-indexing the categories like other archive pages? Any advice is aprreciated Many thanks BC
On-Page Optimization | | benct0 -
Duplicate Content, Same Company?
Hello Moz Community, I am doing work for a company and they have multiple locations. For example, examplenewyork.com, examplesanfrancisco.com, etc. They also have the same content on certain pages within each website. For example, examplenewyork.com/page-a has the same content as examplesanfrancisco.com/page-a Does this duplicate content negatively impact us? Or could we rank for each page within each location parameter (for example, people in new york search page-a would see our web page and people in san fran search page-a would see our web page)? I hope this is clear. Thanks, Cole
On-Page Optimization | | ColeLusby0 -
Duplicate Content - Category Pages 2+
I have my Wordpress SEO settings to deindex past page 1 of each category. However, Google Webmasters is selling me I have 210 pages with duplicate title tags. My site tanked last weekend and I don't know if it was Google Panda or what. I have been getting some fantastic backlinks and it seems like they just decided to disregard all of them as I am completely off the SERPs. Is this duplicate content a contributing factor? How can I get google to deindex my category pages past page 1? (I do need the first page to index as that does bring me organic traffic) Thanks.
On-Page Optimization | | 2bloggers0 -
Losing Page Rank after 301 redirect from http to www
Hi Guys I have site-wide redirected all http// to www and all the category pages lost their page ranks (except home page). I would like to know if this is normal and is it one of the possible causes in losing keyword ranking?
On-Page Optimization | | ilovebodykits0 -
Number of characters to duplicate content
I wonder how much characters in a page title so it can be characterized for Googleas duplicate content?
On-Page Optimization | | imoveiscamposdojordao
Sorry for the English, I used Google Translator.
I'm from Brazil 😄
Thanks.0 -
301 redirects from several sub-pages to one sub-page
Hi! I have 14 sub-pages i deleted earlier today. But ofcourse Google can still find them, and gives everyone that gives them a go a 404 error. I have come to the understading that this wil hurt the rest of my site, at least as long as Google have them indexed. These sub-pages lies in 3 different folders, and i want to redirect them to a sub-page in a folder number 4. I have already an htaccess file, but i just simply cant get it to work! It is the same file as i use for redirecting trafic from mydomain.no to www.mydomain.no, and i have tried every kind of variation i can think of with the sub-pages. Has anyone perhaps had the same problem before, or for any other reason has the solution, and can help me with how to compose the htaccess file? 🙂 You have to excuse me if i'm using the wrong terms, missing something i should have seen under water while wearing a blindfold, or i am misspelling anything. I am neither very experienced with anything surrounding seo or anything else that has with internet to do, nor am i from an englishspeaking country. Hope someone here can light up my path 🙂 Thats at least something you can say in norwegian...
On-Page Optimization | | MarieA1 -
Is is it true that Google will not penalize duplicated content found in UL and LI tags?
I've read in a few places now that if you absolutely have to use a key term several times in a piece of copy, then it is preferable to use li and ul tags, as google will not penalise excessive density of keywords found in these tags. Does anyone know if there is any truth in this?
On-Page Optimization | | jdjamie0