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 ?
😀😀
2
Answers
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 🙂
In your Apache config
This redirects all http requests to the one domain for which you got a SSL certificate