Redirecting all domain aliases to one with htaccess
snippet in htaccess

Redirecting all domain aliases to one with htaccess

user7670

RewriteEngine On
# If the hostname is NOT www.domain.com
RewriteCond %{HTTP_HOST} !^www\.domain\.com$
# 301 redirect to the same resource on www.domain.com
RewriteRule (.*) http://www.domain.com/$1 [L,R=301]