Forum Moderators: phranque
I have been using 'subdomains.domain.com/' for awhile and until recently Google has now begun spidering 'www.domain.com/subdomains/' in their index.
I want to avoid duplicate content problems so need a way to redirect it back to the subdomain in htaccess.
Here is what i have so far (doesnt work). I have tried other codes but i get errors. Thanks for the help.
-----------
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST}!^www¦sub1¦sub2¦sub3\.domain\.com
RewriteRule ^(.*)$ [domain.com...] [R=permanent,L]
RewriteRule ^(.*)/sub1/?$ [sub1.domain.com...] [L,R=301]
RewriteRule ^(.*)/sub2/?$ [sub2.domain.com...] [L,R=301]
RewriteRule ^(.*)/sub3/?$ [sub3.domain.com...] [L,R=301]
-----------
Jim
[edited by: jdMorgan at 5:10 pm (utc) on July 18, 2006]