12
Well surely there must already be a question very similar to this in stackoverflow.
But before they mark it as a duplicate, I have a specification that I haven’t found any "equal" question to this one that I’m going to ask.
Well I intend to do this:
I have several domains whose virtualhost points to the same physical path /www/site/public_html
.
However the example.com domain, I bought ssl and it has https.
What I intended to do was an htacess file that would make me redirect http:// and www to https for my example domain.com.
However, I do not want the other domains to be affected, in other words I do not want the other domains to be https.
In short:
Make 1 condition that if the user comes from http:// example.com or www.exemplo.com to automatically redirect to https:// example.com however, if it comes from another domain do nothing.
How could this be done?
<VirtualHost *:80>
ServerName www.foo.bar
Redirect / https://www.foo.bar/
</VirtualHost>
<VirtualHost *:443>
ServerName www.foo.bar
# ... Configuração SSL
</VirtualHost>
Thank you.
Someone, can help me?
– Gonçalo
Gonçalo, your question has been answered?
– Andre Mesquita