zoukankan      html  css  js  c++  java
  • WORDPRESS改为https部署

    1.确保你已经正确开启了httpd 2.4.6的https配置,并且配置了该网站的虚拟主机,如下所示:

    <VirtualHost *:443>
       DocumentRoot "/appvol/wordpress_blog"
       ServerName robin.org.cn
       ServerAlias www.robin.org.cn
       AddType text/html .php
       <Directory "/appvol/wordpress_blog">
          Options FollowSymLinks
          AllowOverride All
          Require all granted
        </Directory>
    </VirtualHost>
    <VirtualHost *:80>
        DocumentRoot "/appvol/wordpress_blog"
        ServerName robin.org.cn
        ServerAlias www.robin.org.cn
        AddType text/html .php
    
        #对于80端口开启RUL重定向
        RewriteEngine on
        RewriteCond %{HTTPS} !=on
        RewriteRule ^(.*) https://%{SERVER_NAME}$1 [L,R] 
     
        <Directory "/appvol/wordpress_blog">
          Options FollowSymLinks
          AllowOverride All
          Require all granted
        </Directory>
    </VirtualHost>

    2.配置wordpress站点配置文件

    在* @package WordPress后面添加如下配置:
    //added at 2019.1.23
       $_SERVER['HTTPS'] = 'on';
       define('FORCE_SSL_LOGIN', true);
      define('FORCE_SSL_ADMIN', true);

    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');

    前面添加如下配置,如果已经存在,确保http已经修改为https:

    //added at 2019.1.19
    $yovisunhome = 'https://'.$_SERVER['HTTP_HOST'];
    $yovisunsiteurl = 'https://'.$_SERVER['HTTP_HOST'];
    define('WP_HOME', $yovisunhome);
    define('WP_SITEURL', $yovisunsiteurl);

    3.重启httpd

    service httpd restart

    如果您喜欢我,可以通过微信请我喝果汁。

    如果有疑问,可以留言或者发邮件给我 lhh_nj@163.com
  • 相关阅读:
    StepbyStep Guide to XI Transports Using CMS
    Converting File Content in a Sender Adapter
    XI Trace Level
    定义Inbound IDOC
    SAP 各逻辑系统之间数据传输之ALE之分配模型
    SAP 调用外部程序
    HR 事务代码
    业务数据保存时自动触发IDOC
    JDBC adapter Call Stored Procedures
    SAP Query 导入、导出
  • 原文地址:https://www.cnblogs.com/lihuanhuan/p/10612104.html
Copyright © 2011-2022 走看看