Forum Moderators: phranque

Message Too Old, No Replies

Getting rid of /index.php on site access

avoiding google penalization remove dupe pages

         

sandyk20

10:32 am on Mar 13, 2006 (gmt 0)



Hi,
I have a site running as follows, www.mydomain.in
and sub-domains [gallery.mydomain.in...] and [forums.mydomain.in...]

Problem:
All the above sites are also visible via
www.mydomain.in/index.php and gallery.mydomain.in/index.php

I need to get rid /index.php since the same gets marked as duplicate content provided from different pages on same website.

Is there any proper re-direction (301 way) possible which will re-direct users to www.mydomain.in whenever they land-up on www.mydomain.in/index.php same solution is needed for sub-domains as well.

If there is something more better please let me know.

Regards,

jdMorgan

9:23 pm on Mar 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You'll need to use a special form of redirect to avoid a loop:
[code]
RewriteCond %{THE_REQUEST} ^{A-Z}{3,9}\ /index\.php
RewriteRule ^index\.php$ http://www.example.com/ [R=301,L]
[code]
This restricts the redirect to acting only on client requests, and not those that occur as a result of the internal redirections that take place due the the action of the DirectoryIndex directive.

Jim