I recently bought a hosting plan which provides three domains. Since there is only one version of my website, the idea is to redirect all the domains to one single domain ( I think this is also more SEO friendly). So my question is : How can I achieve that ? (Is it as easy as changing something in the .htaccess file?). And Is it possible to buy one SSL certificate for a domain and redirect all other domains ( which have no ssl certificates) to it ?
????????
Advertisement
Answer
in your .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com$
RewriteRule (.*)$ https://www.newdomain.com/$1 [R=301,L]
one damain – one certificate 🙂