答案 0 :(得分:2)
#redirect https traffic for visit_us.php and social.php to http
RewriteCond %{SERVER_PORT} 443
RewriteCond %{REQUEST_URI} ^/visit_us\.php
RewriteCond %{REQUEST_URI} ^/social\.php
RewriteRule ^(.*)$ http://www.myurl.com/$1 [R=301,L]
你不能在这里使用默认的AND
逻辑重写条件 - 它必须是OR
逻辑(用简单的英语阅读你的条件,你会看到缺陷 )。
两种方法:
1。明确指定应使用OR
逻辑:
#redirect https traffic for visit_us.php and social.php to http
RewriteCond %{SERVER_PORT} 443
RewriteCond %{REQUEST_URI} ^/visit_us\.php [OR]
RewriteCond %{REQUEST_URI} ^/social\.php
RewriteRule ^(.*)$ http://www.myurl.com/$1 [R=301,L]
2. 将两个重写条件合并为一个(使用OR逻辑):
#redirect https traffic for visit_us.php and social.php to http
RewriteCond %{SERVER_PORT} 443
RewriteCond %{REQUEST_URI} ^/(visit_us|social)\.php
RewriteRule ^(.*)$ http://www.myurl.com/$1 [R=301,L]