ssl - Apache 2.4 url rewriting with https -
i'm trying url rewriting apache 2.4. want requests to
are remapped
to avoid error in ssl wildcard cert doesn't not match www.subdomain.domain.com.
i tried with:
<virtualhost ip:80> servername subdomain.domain.com rewriteengine on rewritecond %{https} off rewriterule (.*) https://%{http_host}%{request_uri} </virtualhost> <virtualhost ip:80> servername www.subdomain.domain.com redirect permanent / https://subdomain.domain.com </virtualhost> <virtualhost ip:443> servername www.subdomain.domain.com redirect permanent / https://subdomain.domain.com </virtualhost> <virtualhost ip:443> servername subdomain.domain.com ... ... ...
my configuration works (1) , (2) not (3). mistake?
i think problem 1 of port 443 virtualhosts not have ssl on.
try this
<virtualhost ip:443> servername www.subdomain.domain.com redirect permanent / https://subdomain.domain.com sslengine on sslcertificatefile /something sslcertificatekeyfile /something </virtualhost>
otherwise, request won't understood, because it's encrypted.
see eg how redirect https http without ssl certificate why necessary.
Comments
Post a Comment