php - Http to https redirect not working for few pages -


following htaccess code working on home page. when enter my.example.com in url, htaccess redirects https://my.example.com when enter my.example.com/login, it's not redirecting https://my.example.com/login

(i don't want www in domain name)

<ifmodule mod_rewrite.c>     rewriteengine on     options +followsymlinks      rewritebase /     rewriterule    ^$ app/webroot/    [l]     rewriterule    (.*) app/webroot/$1    [l]      rewritecond %{http_host} ^[^.]+\.[^.]+$     rewritecond %{https}s ^on(s)|     rewriterule ^https://%{http_host}%{request_uri} [l,r=301]   </ifmodule> 

please let me know going wrong? thanks

keep redirect rule before internal rewrite ones , fix syntax error in http->https error:

rewriteengine on options +followsymlinks rewritebase /  rewritecond %{https} off rewriterule ^ https://%{http_host}%{request_uri} [l,ne,r=301]  rewriterule (.*) app/webroot/$1 [l] 

Comments

Popular posts from this blog

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

Qt4: how to send QString inside a struct via QSharedMemory -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -