I have a website. I bought all (mydomain.com|net|org|co) domains for my website. Now, I want to redirect all my requests to mydomain.com.Presently, in my httpd.conf, I have ReWrite rules for forwarding http requests to https.
For forwarding all http requests to https
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
I combined my existing settings with this answer and I tried following code:
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{HTTP_HOST} !^example.org$
RewriteRule ^ http://example.org%{REQUEST_URI}
[L,R=301]
It is working fine for http requests but not for https(https://mydomain.net/info). I got SSL certificate for mydomain.com
. It is displaying me This Connection is Untrusted page.
What would be best way to handle this scenario. Can anyone guide me on this
Thanks in advance,
deadMan.