.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

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -