Htaccess force main domain

By.

min read

My profile

Share this:

RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.maindomain\.com [NC]
RewriteRule (.*) https://www.maindomain.com/$1 [R=301,L]

Share this:

Leave a Reply

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