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
-
301 Redirect to external site
Hi guys, We have a client who is getting their website redesigned through us. They are discontinuing couple of their services which will not get featured in the new site. They are fairly well ranked for these services and my client wishes to 301 redirect these pages to an external site owned by his friend so that they benefit out of the ranking. The question is: Will my client's website's general ranking get affected due to 301 redirecting to an external site? The external site is not spammy or red-flagged by Google (at the moment, at least). Thanks in advance!
On-Page Optimization | | RameshNair
Ramesh Nair0 -
Duplicate content issues?
Our company consists of several smaller companies, some of whom deal with very similar things. For instance, two of our companies resell accounts software, but only one provides after-sales support. Because of the number of different companies and websites we have, sometimes it would be easier to simply copy content from one site to the other, optimised in the same manner as, in some instances, we would want different websites to rank for the same keywords. I have been asked my opinion on the potential impact of this practice and my initial response was that we should avoid this due to potential penalties. However, I thought I'd garner opinion from a wider audience before making any recommendations either way. What do people think? Thanks.
On-Page Optimization | | HBPGroup0 -
Boatload of 301 Redirects Question
We have a client that came to us and they recently did a site makeover. Previously they had all their pages in root directory including 75+ spammy article pages. On their makeover, they moved all the article pages into a directory and added 301 redirects. In going over their site we noticed they have redundant articles, like an article on blue-marble-article.htm and blue-marbles-article.htm Playing on singular and plural with dulpicate content for most part with exception to making it plural. If they have 75 articles, Id say 1/3 are actually somewhat original content. I would like to 301 redirect 2/3's of the articles to better re-written article pages but that would add a whole lot more 301 redirects. We would then have a 301 redirect from root directory to article directory, then another 301 redirect from spam article to new re-written article. My question is, would this be too many redirects for googlebot to sort through and would it be too confusing or send bad signals? Or should I create a new directory with all good articles and just redirect the entire old articles directory to the new one? Or just delete the redirects and old spammy directory and let those fall on a 404 error page. Id hate to lose 50-75 pages but I think its in fact those spammy pages that could be why the site fell from top of first page google to third page and now 10th page in a years time. I know, Im confused just typing this out. Hope it makes sense for some good feedback and advise. Thanks.
On-Page Optimization | | anthonytjm0 -
Dealing with thin content/95% duplicate content - canonical vs 301 vs noindex
My client's got 14 physical locations around the country but has a webpage for each "service area" they operate in. They have a Croydon location. But a separate page for London, Croydon, Essex, Luton, Stevenage and many other places (areas near Croydon) that the Croydon location serves. Each of these pages is a near duplicate of the Croydon page with the word Croydon swapped for the area. I'm told this was a SEO tactic circa 2001. Obviously this is an issue. So the question - should I 301 redirect each of the links to the Croydon page? Or (what I believe to be the best answer) set a rel=canonical tag on the duplicate pages). Creating "real and meaningful content" on each page isn't quite an option, sorry!
On-Page Optimization | | JamesFx0 -
Duplicate Content - Potential Issue.
Hello, here we go again, If I write an article somewhere, lets say Squidoo for instance, then post it to my blog on my website will google see this as duplicate content and probably credit Squidoo for it or is there soemthing I can do to prevent this, maybe a linkk back to Squidoo from my website or a dontfollow on my website? Im not sure so any help here would be great, Also If I use other peoples material in my blog and link back to them, obviously I dont want the credit for the original material I am simply collating some of this on my blog for others to have a specific library if you like. Is this going to damage my websites reputation? Thanks again peeps. Craig Fenton IT
On-Page Optimization | | craigyboy0 -
My website is saying I have duplicate page content and page title. How do I fix it?
Hi, I created a website on webstarts.com. After I launched it then ran a scan through SEO it says I have duplicate page content and page title. The 2 pages it is reading are technically the same page. www.mobilemowermedicsinc.com and www.mobilemowermedicsinc.com/index . I am unsure how to get rid of on of these as it keeps saying this is an error in the SEO scan. Could someone please advise me of what to do from here. Thanks!
On-Page Optimization | | bcarp880 -
How to avoid content duplication of my websites
Hello, We are having 4 domains abc.com, abc.in, abc.co.uk, abc.com.au with same content and same inner pages (abc.com/page1, abc.in/page1 etc.) targeting on different geographical areas. How can we avoid duplicate content issue in the home page as well as in the inner pages. Abc.com is the major site. Thank you.
On-Page Optimization | | semvibe0 -
Duplicate page content errors
Site just crawled and report shows many duplicate pages but doesn't tell me which ones are dups of each other. For you experienced duplicate page experts, do you have a subscription with copyscape and pay $.05 per test? What is the best way to clear these? Thanks in advance
On-Page Optimization | | joemas990