I've installed an SSL certificate on one of my sites. I get the following error when I put in my https://mydomain.com instead of https://www.mydomain.com: The name on the security certificate does not match the name of the site. My questions is, is there a way to redirect all users to https://www.mydomain.com via .htaccess? Thanks!
Hello, If your users access https://mydomain.com and you want them to redirect without the (SSL) warning, this is not possible. The only possible combination is an unsecure to secure redirect such that: http://mydomain.com => https://www.mydomain.com A lot of sites suffer from this problem (including some like PayPal), and the only solution is to obtain a SSL certificate with two CN (common name) entries, one with the www, and one without. GoDaddy offer multi-domain SSL certificates, but as you've already got a standard one, I doubt you want this. This solves the problem of two SSL domains on a single IP (at a cost). Hope this helps you, Jay
htaccess... Options +Includes RewriteEngine On RewriteCond %{HTTP_HOST} !^www.yours.com$ [NC] RewriteRule ^(.*)$ http://www.yours.com/$1 [L,R=301] don't know if this will show on this post but hopefully it will... good luck. I use this on all my sites and I do have one which is with no www... works fine
I know it looks wierd but believe me it works... add it and then try going to your site without the www
Thanks ezcat! After I made this post, I was searching around and found the same modrewrite that you have there. But I have a twist I currently have this in my .htaccess DirectoryIndex index.html index.php <IfModule mod_rewrite.c> RewriteEngine on # Some hostings require RewriteBase to be uncommented # Example: # Your store url is http://www.yourcompany.com/store/cscart # So "RewriteBase" should be: # RewriteBase /store/ RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php?sef_rewrite=1 [L,QSA] </IfModule> Code (markup): I need to keep the above plus force www. Do you know how to do that? Thanks, Jon