apache - How to permanent redirect an HTTP to HTTPS SSL url? -
how can redirect incoming http requests local https configuration in apache2 on ubuntu?
the following not work, because localhost not replaced internal server ip.
<virtualhost *:80> redirect / https://localhost </virtualhost> <virtualhost *:443> proxypass ... </virtualhost> is possible without having explicit hardcode local server ip redirect?
this should do:
<virtualhost *:80> ... rewriteengine on rewriterule ^ https://%{http_host}%{request_uri} [l,r=302] </virtualhost> once sure works ok, change 302 301
Comments
Post a Comment