2014-01-19 5 views
0

Joomla 1.5 및 Virtuemart 1.1.9에서 Joomla 2.5 및 Virtuemart 2로 사이트를 마침내 업데이트했습니다. Virtuemart의 민감한 영역에 SSL을 사용하도록 설정했으나 시도하지 않았습니다. 그리고 대신 .htaccess를 사용하여 리다이렉션을하고 싶습니다..htaccess로 민감한 지역에 http를 https로 리디렉션

이 코드를 시도하고 내 사이트 웹 사이트의 루트에있는 경우가 작동합니다하지만 하위 폴더 즉 www.uniqbuy.com/electronics에

난 안에이 코드를 얻을 수있는 방법 https로 리디렉션 할 때 URL에서 전자 제품을 제거 하시겠습니까?

# Force SSL on checkout login account and admin pages 
RewriteCond %{HTTPS} off 
RewriteCond %{REQUEST_URI} checkout|login|my-account|administrator|webshop 
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$ [NC] 
RewriteRule ^(.*)$ https://%2/$1 [R=301,L,QSA] 

# Remove SSL on other pages 
RewriteCond %{HTTPS} on 
RewriteCond %{REQUEST_URI} !checkout|login|my-account|administrator|webshop 
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$ [NC] 
RewriteRule ^(.*)$ http://www.%2/$1 [R=301,L,QSA] 

# Force www for non https 
RewriteCond %{HTTPS} off 
RewriteCond %{HTTP_HOST} !^www\. [NC] 
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L,QSA] 

도움이 될 것입니다.

감사합니다.

답변

0

두 번째 규칙은 잘못된 정규식을 사용하고있는 것 같습니다. 다음 코드를 사용해보십시오.

# Force SSL on checkout login account and admin pages 
RewriteCond %{HTTPS} off 
RewriteCond %{REQUEST_URI} (checkout|login|my-account|administrator|webshop) 
RewriteCond %{HTTP_HOST} ^(www\.)?(.+)$ [NC] 
RewriteRule ^(.*)$ https://%2/$1 [R=301,L] 

# Remove SSL on other pages 
RewriteCond %{HTTPS} on 
RewriteCond %{REQUEST_URI} !(checkout|login|my-account|administrator|webshop) 
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$ [NC] 
RewriteRule ^(.*)$ http://www.%2/$1 [R=301,L] 

# Force www for non https 
RewriteCond %{HTTPS} off 
RewriteCond %{HTTP_HOST} !^www\. [NC] 
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L,QSA] 
+0

감사합니다. 하위 폴더에 설치 한 상태로 작업 할 수 있었지만 카트 내용을 http와 https 사이에서 전환되는 메모리에 보관하지 못했습니다. 그런 다음 위어 SSL 리다이렉션을 발견하고 모든 문제를 해결했습니다. –

관련 문제