htaccess redirect only if domain matches
snippet in htaccess

htaccess redirect only if domain matches

user4951

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R,L]