我在我的WordPress网站上使用以下规则:
https重定向工作正常;但是,职业页面不会重定向到http。知道为什么吗?
以下是我在wp-config.php中的内容
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);
define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);发布于 2015-06-15 16:04:30
尝试使用THE_REQUEST而不是REQUEST_URI
<IfModule mod_rewrite.c>
RewriteEngine On
# Go to https if not on careers
RewriteCond %{SERVER_PORT} =80
RewriteCond %{THE_REQUEST} !/careers/[\s?] [NC]
RewriteRule ^(.*)$ https://www.mywebsite.com/$1 [R,L]
# Go to http if you are on careers
RewriteCond %{SERVER_PORT} !=80
RewriteCond %{THE_REQUEST} /careers/[\s?] [NC]
RewriteRule ^(.*)$ http://www.mywebsite.com/$1 [R,L]
</IfModule>THE_REQUEST变量表示Apache从浏览器接收到的原始请求,并且在执行某些重写规则后不会被覆盖。这个变量的示例值是GET /index.php?id=123 HTTP/1.1。
确保这些规则置于WP默认规则之上。
https://stackoverflow.com/questions/30849643
复制相似问题