Rewrite all domains to .co.uk .com .net

This will redirect

domain.com
www.domain.com
domain.co.uk
www.domain.co.uk
www.domain.net

to domain.net


RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^excludedsubdmain.(.*)$ [NC]
RewriteCond %{HTTP_HOST} ^((www.)?domain.(com|co.uk)|www.domain.net) [NC]
RewriteRule ^(.*)$ http://domain.net/$1 [L,R=301]

Add a Comment

Your email address will not be published. Required fields are marked *