Redirect website multiple domain to single domain using htaccess
RewriteEngine on
RewriteCond %{HTTP_HOST} ^http://domainname.com [OR]
RewriteCond %{HTTP_HOST} ^https://www.domainname.com [OR]
RewriteCond %{HTTP_HOST} ^http://www.domainname.com [OR]
RewriteCond %{HTTP_HOST} ^www.domainname.com
RewriteRule ^(.*)$ https://domainname.com/$1 [R=permanent,L]
# or
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domainname.com
RewriteRule ^(.*)$ https://www.domainname.com/$1 [R=permanent,L]
Comments
Post a Comment