.htaccess - https 301 redirect and sub domains not working -
i use following code redirect http https in htaccess. following code works fine in redirecting me https version.
rewriteengine on rewritecond %{https} off rewriterule ^ https://www.domain.com%{request_uri} [ne,r=301,l]
but when create sub domain, http://example.domain.com redirecting https://www.domain.com.. how solve ?
try :
rewriteengine on rewritecond %{http_host} !^sub\.domain\.com$ rewritecond %{https} off rewriterule ^ https://www.domain.com%{request_uri} [ne,r=301,l]
Comments
Post a Comment