Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

example.com and example.com/index.php

Could this solve the problem?

         

TomH27

4:43 pm on Nov 19, 2006 (gmt 0)

10+ Year Member



one of my clients sets external links to www.example.com and www.example.com/index.php.
google now index both, the domain and the index.php.
both sites get an pr of 6.
to solve the problem and avoid the dupe content, i want to try the following.

1. copy index.php to index.htm
2. change the content of the index.php
3. tells the server to prefer the index.htm as main

so i avoid the dupe content problem and all things could be great!?

what do you think about it?

thanks, tom

shogun_ro

9:10 pm on Nov 19, 2006 (gmt 0)

10+ Year Member



Put this lines to your.htaccess:

RewriteEngine on

RewriteCond %{THE_REQUEST} ^.*\/index\.php
RewriteRule ^(.*)index\.php$ http://www.example.com/$1 [R=301,L]

tedster

11:04 pm on Nov 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The idea is that ONLY the domain root should be indexed, not the page name + extension version. So yes, do the permanent redirect but also fix all the interal "Home" links to point to the domain root, whichever version you prefer (no-www or with-www).

This is a well discussed topic on this forum. The broader issue is having only one url in the index that points to any bit of content, not just index pages. Problems can come in my ways: index.htm, with and without the "www", https and http, different order of query string parameters... and it all falls into the topic of duplicate URLs, which is a subset of the even bigger topic of duplicate content.

It's all very thoroughly discussed here:
Duplicate Content - get it right or perish [webmasterworld.com]