[英]Cpanel/WHM server can not redirect wordpress site from http to https
I received my certificate through Comodo and installed it through cPanel. 我通过Comodo收到了证书,并通过cPanel安装了它。 It shows up on my browser when I go to the url, but I am unable to get the content of the webpage as I get a 302 redirect loop.
当我转到url时,它会显示在我的浏览器中,但由于出现302重定向循环,因此无法获取网页的内容。 I changed my htaccess file to
我将htaccess文件更改为
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.org/$1 [R,L]
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
within the wordpress admin editor, I changed my website from http to https. 在wordpress管理员编辑器中,我将网站从http更改为https。
Try the following code to redirect from http to https 尝试以下代码从http重定向到https
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.example.org/$1 [R,L]
create a new .htaccess file with the default rules of wordpress >> In Cpanel redirects options , configure a permanent redirect from http to https with or without www >> you may also need to use a wordpress plugin that apply the proper ssl security to the images and the posts 使用wordpress的默认规则创建一个新的.htaccess文件>>在“ Cpanel重定向”选项中,配置从http到https的永久重定向(带或不带www >>),您可能还需要使用将适当的ssl安全性应用于的wordpress插件图片和帖子
and then check. 然后检查。
Could you please modifies the https rule in .htaccess 您能否修改.htaccess中的https规则
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
and also go to wordpress setting and chnage the domain redirection http://example.com to https://example.com 并转到wordpress设置并更改域重定向http://example.com到https://example.com
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.