나는이 질문이 몇 가지 다른 방법으로 질문되었으며 나는 여러 가지 제안을 보았고/시도했지만 어디에도 가지 않았다..htaccess에서 http와 https 사이를 전환하려면 어떻게해야합니까?
나는 http와 https가 혼합 된 사이트를 가지고 있는데, 모든 하위 디렉토리를 포함한/customer 및/cart는 모두 https이고 나머지는 http입니다. 나는 실제로 https로가는 문제가 있는데, 마치 https로 가고 바로 이걸로 http로 간다.
RewriteEngine On
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule (.*) /public.php?debug=%{SERVER_NAME} [NS,QSA,L]
# Redirect to HTTPS if /cart or /customer
RewriteCond %{REQUEST_URI} ^/cart.*
RewriteCond %{REQUEST_URI} ^/customer.*
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R]
# go back to regular http if not in secure area
RewriteCond %{REQUEST_URI} !^/cart.*
RewriteCond %{REQUEST_URI} !^/customer.*
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L,R]
#simulate the static pages
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ /public.php?controller=index&action=index [L]
#Main rewrite for application/controller/action decode logic
#RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !/scripts/
RewriteCond %{REQUEST_FILENAME} !/images/
RewriteCond %{REQUEST_FILENAME} !/css/
RewriteRule ^([a-z]+)\/([a-z]+)$ /public.php?controller=$1&action=$2 [QSA,L]
RewriteRule ^([a-z]+)\/$ /public.php?controller=$1 [QSA,L]
RewriteRule ^([a-z]+)\/([a-z]+)$ /$1/$2/ [QSA,L,R]
RewriteRule ^([a-z]+)$ /$1/ [QSA,L,R]
AddHandler php5-script .php
어쩌면 누군가 나를 교정 할 수 있습니다.
TIA