YAZONG 我的开源

wordpress(阿里云)设置HTTPS及HTTP重定向

  ,
0 评论0 浏览

一、申请域名和备案略过。

二、申请SSL证书(可以选择上传也可以选择购买)

三、域名绑定和开启HTTPS

#这里会在XX/conf/extra/httpd-ssl.conf中自动生成下述SSL配置文件

<VirtualHost *:443>

SSLEngine On
SSLHonorCipherOrder on
DocumentRoot “XX”
ServerName XX
ServerAdmin XX
SSLCertificateFile conf/XX/cert.pem
SSLCertificateKeyFile conf/XX/cert.key
#SSLCertificateChainFile conf/XX/chain.pem
BrowserMatch “MSIE [2-5]” nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0

四、设置wordpress后台管理的域名配置

五、设置HTTP跳转HTTPS

在XX/apache/conf/extra/httpd-ssl.conf中配置下述内容:

<VirtualHost *:80>

RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}$1 [L,R]

注:

apache停止命令: ./apachectl -k stop

apache开启命令: ./apachectl -k start

apache查看版本命令: ./apachectl -v


标题:wordpress(阿里云)设置HTTPS及HTTP重定向
作者:yazong
地址:https://blog.llyweb.com/articles/2019/02/07/1578152382725.html