Redirect a .co.uk (TLD) to a .com and include all other pages

Posted 2 years ago

The below code will redirect all urls (both www. and non www.) to a www.domain.com


RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^(www\.)?domain\.co\.uk$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]