您现在的位置: 首页 > 建站课程 > WordPress

WordPress 狗爹(godaddy)主机在配置了ssl后做的301跳转,自动跳转到https的方法

来源:源码网 发布时间:2020-12-26 14:07:31热度:IT源码网
以下是狗爹(godaddy)主机使用WordPress 在配置了ssl后做的301跳转,自动跳转到https的方法。

1、后天修改网址 https
2、修改文件.htaccess 代码如下↓。

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


</IfModule>

    RewriteEngine On
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


# END WordPress
    责任编辑:老铁