ssl - 在 Cpanel 上添加重定向 (301) 规则以强制 ssl 时出错

标签 ssl cpanel

我是服务器和 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/

相关文章:

ssl - 使用现有私钥创建 CSR

python - 如何使用 pyOpenSSL 生成证书以使其安全连接?

linux - 如何在 vsftpd 中强制只接受 ssl 连接?

apache - 服务器不查找 www 或其他子域

cPanel 无法确定名称服务器 IP 地址

php - 如何防止 CronJob 创建日志文件?

django - 如何在 Django 应用程序中使用 SSL(使用 mod_wsgi 和 virtualenv 部署)

ssl - IBM Worklight 如何实现 HTTPS Adapter?

c# - cpanel远程连接mysql数据库

git - 在 cPanel 上克隆 Azure 存储库