如何从HTTPS切换回HTTP?

时间:2017-11-01 21:41:19

标签: php apache .htaccess

我最近使用此代码将我的URL从HTTP转换为HTTPS:

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

但现在我想恢复一切,因为我改变主意并打破了一切。

我正在使用此代码:

RewriteCond %{HTTPS} ^on$
RewriteRule ^(.*)$ http://example.com/$1 [NC,L,R]

但它似乎只适用于某些页面。

我如何在所有页面上使用它?

1 个答案:

答案 0 :(得分:0)

RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

这帮助了我!