V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Explorare
V2EX  ›  Apache

WordPress 无限循环重定向求助

  •  
  •   Explorare · 2016-07-11 01:13:28 +08:00 · 3348 次点击
    这是一个创建于 2845 天前的主题,其中的信息可能已经有所发展或是发生改变。

    之前一直用 docker 部署,现在打算直接部署,遇到了这个问题。 域名: http(s)://ex.hencolle.com/ NS/CDN 和 SSL 都是 CloudFlare 提供,直接将 docker 中的 sql 数据和 html 数据取出来覆盖了 /var/www/hencolle 。目前 CloudFlare 上关掉了 CDN / SSL / HSTS 这个 VPS 上原本就部署了一个网站,占用了 80 和 443 端口。

    /var/www/hencolle/.htaccess

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^hencolle\.com$ [NC]
    RewriteRule ^(.*)$ http://ex.hencolle.com/$1 [R=301,L]
    </IfModule>
    

    /etc/apache2/sites-available/hencolle.conf

    <VirtualHost *:80>
        Protocols h2c http/1.1
            ServerName ex.hencolle.com
            ServerAdmin [email protected]
            DocumentRoot /var/www/hencolle
        RedirectMatch permanent ^/(.*) https://ex.hencolle.com/$1
    </VirtualHost>
    

    wp-config.php

    define('WP_HOME','http://ex.hencolle.com');
    define('WP_SITEURL','http://ex.hencolle.com');
    

    求助

    5 条回复    2016-07-11 09:50:18 +08:00
    Kaiyuan
        1
    Kaiyuan  
       2016-07-11 01:32:24 +08:00
    先取消 SSl 然后安装 CloudFlare Flexible SSL https://wordpress.org/plugins/cloudflare-flexible-ssl/
    alect
        2
    alect  
       2016-07-11 08:33:17 +08:00
    以前用了 hsts ? 先清下 cookies ,要不然一直还会访问 https
    Explorare
        3
    Explorare  
    OP
       2016-07-11 09:21:07 +08:00
    @alect HSTS 和 SSL 昨晚就关了,刚才清了饼干还是会自动跳转 https 。然而我没证书就没配置 443 端口。
    Explorare
        4
    Explorare  
    OP
       2016-07-11 09:29:10 +08:00
    @Kaiyuan 昨晚关了 SSL 和 HSTS ,今天还是跳 https ,而且还是无法访问 wp 控制台所以没法装插件。不过我记得这个插件是装过的。
    alect
        5
    alect  
       2016-07-11 09:50:18 +08:00
    @Explorare 搜下 sql 数据库吧, https://domain.com 替换为 http://domain.com
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3222 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 00:36 · PVG 08:36 · LAX 17:36 · JFK 20:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.