What could be the cause of this duplicate content error?
-
I only have one index.htm and I'm seeing a duplicate content error. What could be causing this?
-
Hey Scott,
3 things you should do:
-
Determine whether you want to include the index.htm or not. It doesn't really matter which one you choose as long as you're consistent, but pick one and stick to that linking structure from now on. If your site has a lot of backlinks to the homepage, see which variation has the most backlinks (usually it's the one without the index).
-
Include a canonical tag in the section of your homepage, if you go with the sans-index version, use the following code:
rel="canonical" href="http://www.suncoastlaw.com/" />
- If you are familiar with the htaccess file, add the following code to it. This will redirect all index.htm files to the root directory:
RewriteEngine On
RewriteBase /
RewriteRule ^index.htm$ / [NC,R,L]
Hope that helps!
-
-
That helps a lot. I already added this for a 301 redirect a couple of days ago.
RewriteEngine on
rewritecond %{http_host} ^suncoastlaw.com [nc]
rewriterule ^(.*)$ http://www.suncoastlaw.com/$1 [r=301,nc]
Should I just add your last two lines to the bottom of this .htaccess?
-
Yes, no need to repeat the "RewriteEngine on" line. It's also a good idea to include the canonical tag on the homepage, just in case.