【问题标题】:issues with wordpress redirection to https instead of http sitewordpress 重定向到 https 而不是 http 站点的问题
【发布时间】:2013-11-26 12:18:43
【问题描述】:

全部,

我有一些 wordpress 的 mod 重写规则,在我今天测试之前工作正常。尽管我的 mod 重写到 http 链接中有明确的重定向,但我的所有请求都通过 https。

以下是我的重定向

RewriteCond %{HTTP_HOST} ^(www\.)?mycompany\.com$ [NC]
RewriteRule ^/abc/?$ http://ww2.mycompany.com/test/abc.html/? [R=301,L]

如果我继续在 url 中输入 www.mycompany.com/abc,它会将我重定向到 https://ww2.mycompany.com/test/abc.html/ 而不是 http://ww2.mycompany.com/test/abc.html/

不确定在我至少一年前实施时发生了什么变化。

任何帮助将不胜感激。 谢谢

【问题讨论】:

  • 您能在浏览器开发工具的网络面板上查看所有实际显示的重定向吗?
  • 愚蠢的问题:如果你进入 Wordpress -> 设置,在 Wordpress 数据库中保存的网站 url 是什么?

标签: wordpress apache .htaccess mod-rewrite redirect


【解决方案1】:

删除前导斜杠:

RewriteCond %{HTTP_HOST} ^(www\.)?mycompany\.com$ [NC]
RewriteRule ^abc/?$ http://ww2.mycompany.com/test/abc.html/? [R=301,L]

.htaccess 是每个目录指令,Apache 从 RewriteRule URI 模式中去除当前目录路径。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-11
    • 2014-08-18
    • 2018-02-28
    • 2011-05-27
    • 1970-01-01
    • 2015-09-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多