Recently my google webmasters account for my website showed I had duplicate title tags. They were "/" and "/index.php" which are the same page. How can I fix this? If I add index.php to robots.txt will this work? Will it remove my homepage?

Comments

mdlueck’s picture

As the search engine need not know EXACTLY the filaname of the default page in order to index the "/" URL.

I have used Google Webmaster tools for a long time, never have seen that grip yet.

How did you generate your sitemap file? With the xmlsitemap module?

jcontraros’s picture

Yes I used the XML Sitemap module. I do not see "index.php" on the sitemap though, yet google webmasters shows it. I did not have this problem until today. The other day I made changes to my .htacess file to redirect non-www to www. I think this may have something to do with it? I added index.php to robots and I will see what happens. Thanks.

mdlueck’s picture

I am quite familiar with the .htaccess rules to shift the domain name onto the correct domain name. Doubt that is the source of what put Google onto index.php. Perhaps Google picked that tidbit up from a direct link from another site? (shrug)

mdlueck’s picture

I think you should simply do an Apache 301 redirect of /index.php to /

Should be...

# .htaccess
redirect 301 /index.php http://www.domain.com/
mrfelton’s picture

This one did it for me.

# index.php to /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]

Add it to your .htaccess file after RewriteBase / but before the line #Rewrite URLs of the form 'x' to the form 'index.php?q=x'

--
Tom
www.systemseed.com - drupal development. drupal training. drupal support.