Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 使用https强制重定向_Wordpress_.htaccess_Http_Https - Fatal编程技术网

Wordpress 使用https强制重定向

Wordpress 使用https强制重定向,wordpress,.htaccess,http,https,Wordpress,.htaccess,Http,Https,我正在将我的页面从HTTP重定向到HTTPS,但它根本不起作用,我的页面是wordpress,我有来自digital ocean的SSL证书,带有lets encrypt,这些是我的案例 WORKS http://mipagina.com -> https://mipagina.com IT DOES NOT WORK http://www.mipagina.com -> https://mipagina.com 这是我的.htaccess RewriteEngine On Re

我正在将我的页面从HTTP重定向到HTTPS,但它根本不起作用,我的页面是wordpress,我有来自digital ocean的SSL证书,带有lets encrypt,这些是我的案例

WORKS
http://mipagina.com -> https://mipagina.com

IT DOES NOT WORK
http://www.mipagina.com -> https://mipagina.com
这是我的.htaccess

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} 
[R=301,L]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
重新编写引擎打开
重写条件%{HTTPS}关闭
重写规则(*)https://%{HTTP\u HOST}%{REQUEST\u URI}
[R=301,L]
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
非常感谢您的帮助

请记住,“mipagina.com”和“www.mipagina.com”从http服务器的角度来看是完全不同的主机。确保它们由相同的虚拟主机提供服务,以便应用相同的规则。。。