Force https question
I 've read that SSL handshaking takes place before rewrite rules in htaccess and I though to use something like
I've seen some people doing something similar Nginx: redirect non-www to www on https in nginx and I thought if there is a way to do this in apache. Of course I tried the above code but I'm definitely no expert at this. Does anybody know how to do it?
NameVirtualHost se.rv.er.ip:443
ServerName www.mydomain.tld
Redirect permanent / https://mydomain.tld/
I've seen some people doing something similar Nginx: redirect non-www to www on https in nginx and I thought if there is a way to do this in apache. Of course I tried the above code but I'm definitely no expert at this. Does anybody know how to do it?
-
Thank you for your answer, I've just tried but it doesn't redirect from before it fail in the SSL handshake. I guess it can not be done. 0 -
This is what I use to force https in .htaccess: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]0 -
Hello :) Most SSL providers allow "non-www" and "www" to work on a default SSL certificate purchased. Is this not the case with your certificate, or are you attempting to redirect between different domain names? Thank you. 0 -
I purchased a multidomain certificate and didn't know that choosing mydomain.com doesn't cover www.mydomain.com. They need $25/domain to cover all the www versions. So I wanted to redirect the traffic from www to non www through https but I suppose this is not going to happen because of the the ssl handshake taking place before the redirects.. I'm not sure if a reverse proxy in the front could help. 0 -
Is "Let's Encrypt" an alternative you are open to if the cost is a concern? There's a thread on it at: [How-To] Installing SSL from Let's Encrypt Thank you. 0 -
Thank you, good link 0
Please sign in to leave a comment.
Comments
6 comments