Forum Moderators: phranque
# Root redirect exclusions
# Exclude hostnames "example.co.za" and "www.example.co.za" and blank
RewriteCond %{HTTP_HOST} !^((www\.)?example\.co\.za\.?(:[0-9]+)?)?$
# Exclude phpinfo.php, sitemap.xml and robots.txt (applicable to root website only)
RewriteCond $1 !^(phpinfo\.php|sitemap\.xml|robots\.txt)$
# Externally redirect all other requests to "sub.domain.com"
RewriteRule ^(.*)$ http://sub.example.com/$1 [R=301,L] SetEnvIf User-Agent ^googlebot googlebot
Order Deny,Allow
Allow from env=googlebot RewriteCond %{env:googlebot} ^$ [edited by: jdMorgan at 10:01 pm (utc) on May 31, 2010]
[edit reason] Please use example.com only. [/edit]
RewriteCond %{HTTP_USER_AGENT} googlebot [NC]
RewriteCond %{HTTP_USER_AGENT} !googlebot [NC]