Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!



Photo
- - - - -

Help With Sitemap Showing Duplicate Index Pages In My Subfolders.


  • Please log in to reply
3 replies to this topic

#1 cmparker

cmparker

    HR 1

  • Members
  • Pip
  • 2 posts
  • Location:Gulfport, MS

Posted 20 April 2012 - 11:13 AM

My sitemap is indexing both site.com/folder and site.com/folder/index.html as the same page. How do I get just one or the other to show up?

I know that Google does not like it when you have duplicate pages, but I can't figure out how to fix it. From a little bit of internet research it seems like I need to add some code to the .htaccess file in my root directory, but I have had no luck with the examples I have found.

I am using Godaddy for hosting and domain, if that makes a difference. The problem is affecting all of my sub folder index pages, not just that particular one.

Please help!

Edited by chrishirst, 20 April 2012 - 11:31 AM.


#2 qwerty

qwerty

    HR 10

  • Moderator
  • 8,615 posts
  • Location:Somerville, MA

Posted 20 April 2012 - 12:49 PM

There is .htaccess code that will set up 301 redirects from site.com/folder/index.html to site.com/folder/, but I don't memorize such things, and I don't have a copy of it here in the office. Maybe someone else can post it for you.

But you shouldn't need that code just to keep your own sitemap from including the file name of a default document in addition to the URL of the directory. You must have internal links in your own HTML that point to site.com/folder/index.html, and even if you set up the redirects, you're much better off recoding those links to point to the preferred URL in the first place. The 301 should be in place to redirect requests you can't control, like links from other sites, but if you do have control over a given link, just edit the link.
  • Jill likes this

#3 cmparker

cmparker

    HR 1

  • Members
  • Pip
  • 2 posts
  • Location:Gulfport, MS

Posted 20 April 2012 - 01:41 PM

Grr, so simple. I should have noticed that! You were right, I had some urls pointing to the index.html and others pointing to the folder. Thank you so much! I've been looking at that for two days.

#4 qwerty

qwerty

    HR 10

  • Moderator
  • 8,615 posts
  • Location:Somerville, MA

Posted 21 April 2012 - 11:08 AM

OK, that's a step in the right direction. Here's the redirect code we talked about. You'll need to edit it to replace "url.com" with your domain name and if your default documents aren't named index.html you'll need to change that too. This code also includes the redirect from non-www URL to the www versions.
RewriteEngine on
# Force requests for named index files to drop the index file filename, and force www:
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*index\.(html?|php)(\?[^\ ]*)?\ HTTP/
RewriteRule ^(([^/]*/)*)index\.(html?|php)$  http://www.url.com/$1  [R=301,L]
#
# Redirect non-www to www:
#
RewriteCond %{HTTP_HOST}   ^url\.com					 [NC]
RewriteRule  (.*)		   http://www.url.com/$1	    [R=301,L]





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

SPAM FREE FORUM!
 
If you are just registering to spam,
don't bother. You will be wasting your
time as your spam will never see the
light of day!