如何删除https

时间:2016-04-12 04:19:50

标签: .htaccess http ssl https ssl-certificate

在我的网站上,只有少数网页使用https。我不知道它的来源,但我必须删除那些https。我怎样才能实现。

我当前的.htaccess设置

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /indiv/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /indiv/index.php [L]
 RewriteCond %{HTTPS} on
RewriteRule ^/?$ http://%{SERVER_NAME}/indiv/ [R=301]
RewriteRule ^indiv/?$ http://%{SERVER_NAME}/indiv/ [R=301,L]
</IfModule>

1 个答案:

答案 0 :(得分:0)

用以下代码替换所有代码:

RewriteEngine On
RewriteBase /indiv/

RewriteCond %{HTTPS} on
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]

RewriteRule ^index\.php$ - [NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]