强制将https重定向到http(指向子文件夹的主域)

时间:2017-04-12 17:46:04

标签: .htaccess mod-rewrite

我的htacess文件中有这个:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(staging.)?example.com$
RewriteCond %{REQUEST_URI} !^/staging/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /staging/$1
RewriteCond %{HTTP_HOST} ^(staging.)?example.com$
RewriteRule ^(/)?$ staging/index.php [L]

如何强制所有https请求到http?

1 个答案:

答案 0 :(得分:0)

类似的东西:

RewriteCond %{HTTPS} /on/
RewriteRule ^(.*)$ http://hostname/$1 [L,R]

规则必须是重定向才能从HTTPS切换到HTTP。