【发布时间】:2015-12-05 09:41:14
【问题描述】:
我尝试了一些 htaccess 语句,但它对我不起作用。我需要将整个站点与 https 一起使用,除了一个页面需要来自另一个站点的 http 连接,因此我需要为此页面禁用 https。
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
RewriteCond %{HTTPS} on
RewriteCond %{SCRIPT_FILENAME} \/exp\.php [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [L,NC]
浏览器说重定向似乎太多了。
【问题讨论】:
标签: php apache .htaccess mod-rewrite url-rewriting