我是服务器和 cpanel 的新手。我已经在我的域上成功购买并安装了 ssl 证书。现在,当我尝试为 cpanel 下的所有流量将 http 的重定向 (301) 添加到 HTTPS 时,它给出错误“处理您的请求时 Apache 规则中的错误”。
请帮忙
最佳答案
Cpanel官方文档说:
If you try to setup a Dedicated SSL redirect using the cPanel steps , cPanel will fail with an error message.
最好将重写规则直接写入根目录下的 .htaccess 文件中。 See here for inmotion hosting help page
在 .htaccess 中试试这个:
RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
关于ssl - 在 Cpanel 上添加重定向 (301) 规则以强制 ssl 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36893894/