Help with .htaccess redirect
Posted: Sun Mar 15, 2015 9:18 pm
Hi, I'm hoping someone skilled in web hosting issues can help with this. I have two domains, example.com and example.ca. The .com domain is meant to redirect to the .ca webspace in all cases. The .ca domain has an ssl certificate and is accessed via https://example.ca. Here's what I have right now:
Can someone suggest a redirect that will catch https://example.com and change it to https://example.ca? I'm hoping this is possible without buying a second ssl certificate.
I really am quite a noob on this subject, thanks in advance for any help.
This seems to work fine in most cases, however there is a case that it's failing. If someone types https://example.com it doesn't redirect properly, they get taken to a page telling them it's unsafe to proceed. Of course, https://example.com doesn't exactly exist, https://example.ca does.RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ https://example.ca/$1 [L,R=301,NC]
Can someone suggest a redirect that will catch https://example.com and change it to https://example.ca? I'm hoping this is possible without buying a second ssl certificate.
I really am quite a noob on this subject, thanks in advance for any help.