need .htaccess 301 redirect to remove extra pages indexed on virtual domain

Discussion in 'Apache' started by Trend Hunter, Aug 21, 2006.

  1. #1
    I have virtual domain: www.adcult.com which runs off the same server as my main site: www.trendhunter.com. However, Google has found a way to index all of the trendhunter pages using the adcult virtual domain (yikes). For example: www.adcult.com/forums should never appear... only www.trendhunter.com/forums should appear.

    Ideally, I want to 301 redirect ALL pages on adcult to the trendhunter domain UNLESS the following rules are met:

    segment_1 = "" (www.adcult.com)
    segment_1 = "adcult-rss (www.adcult.com/adcult-rss/)
    segment_1 = "ads" (www.adcult.com/ads/..... -these are my articles)
    segment_1 STARTS with p (www.adcult.com/P... - this is my pagination /P10, /P20, /P30....

    How could I do this?

    The following is my current .htaccess:
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]

    #RewriteCond %{THE_REQUEST} !^POST
    #RewriteRule ^weblog/?(.*)$ /$1 [R=301,L]
    #RewriteCond $1 !^(images|path.php|index\.php)
    #RewriteRule ^(.*) index.php/weblog/$1 [L]

    Redirect permanent /images http://www.trendhunter.com/images
    Redirect permanent /thcp http://www.trendhunter.com/system
     
    Trend Hunter, Aug 21, 2006 IP