简体   繁体   English

通过cPanel将HTTPS重定向到HTTP

[英]Redirects HTTPS to HTTP via cPanel

How could I redirect HTTPS to HTTP via cPanel ? 如何通过cPanel将HTTPS重定向到HTTP? I have been trying to redirect it from .htaccess but it still not work. 我一直在尝试从.htaccess重定向它,但仍然无法正常工作。

Thanks 谢谢

If you don't have an active SSL you may need to do the .htaccess redirect this way 如果您没有有效的SSL,则可能需要以这种方式进行.htaccess重定向

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

There are some specific cases when you want to redirect particular URL or a single website to be opened through HTTP instead of HTTPS. 在某些特定情况下,您想重定向特定的URL或通过HTTP而不是HTTPS打开单个网站。 For that purpose you should add the following rewrite rule in your .htaccess file: 为此,您应该在.htaccess文件中添加以下重写规则:

RewriteCond %{HTTP:X-Forwarded-Proto} =https RewriteRule ^(.*)$ http://% {HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond%{HTTP:X-Forwarded-Proto} = https RewriteRule ^(。*)$ http://% {HTTP_HOST}%{REQUEST_URI} [L,R = 301]

This will redirect your https to http. 这会将您的https重定向到http。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM