.htaccess - Rewrite specific sub domain to SSL based? -
i use apache 2 on debian 7.
i have online tool installed @ let's say:
tool.myurl.net
i have wildcard ssl certificate for:
*.myurl.net
i configured virtualhost
in apache listen tool.anotherurl.com
using serveralias
.
but not have valid ssl certificate url.
so need rewrite rule redirect http://tool.myurl.net
https://tool.myurl.net
not when people visit http://tool.anotherurl.com
.
is possible?
if understood correctly want redirect https sub domain tool.myurl.net
rule should it:
rewriteengine on # if https not being used force https rewritecond %{https} !=on # because want force domain rewritecond %{http_host} ^tool\.myurl\.net$ [nc] rewriterule ^ https://%{http_host}%{request_uri} [l,r=301]
Comments
Post a Comment