【发布时间】:2013-08-16 18:29:29
【问题描述】:
我有 HTTPS 证书,我不会将其限制在一个文件夹 /xcart/ 中,但我不想从其他文件夹和页面访问。是否可以使用 .htaccess 进行此限制?
谢谢
【问题讨论】:
我有 HTTPS 证书,我不会将其限制在一个文件夹 /xcart/ 中,但我不想从其他文件夹和页面访问。是否可以使用 .htaccess 进行此限制?
谢谢
【问题讨论】:
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !^/xcart/.*
RewriteRule (.*) http://%{HTTP_HOST}/$1 [R,L]
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ^/xcart/.*
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R,L]
【讨论】: