RewriteEngine On RewriteCond %{HTTP_HOST} !^(.*)\.domain\.com RewriteRule (.*) http://www.google.com/search?hl=en&site=domain.com&q=domain.com&btnG=Search [R=301,L]