2011-12-12 55 views
3

我想重新从ssl重定向到apache中的非ssl,我没有任何运气。这可以通过htaccess完成吗?将ssl重定向到非ssl

RewriteEngine On 
RewriteBase/

RewriteCond %{HTTPS} on 
RewriteCond %{HTTP_HOST} www.mydomain.org 
RewriteRule (.*) http://www.mydomain.org/$1 [R=301,L] 
+0

使用RewriteLog和RewriteLogLevel指令启用日志记录,它会告诉你它在做什么。 –

+0

因此,一切从htaccess规则看起来都不错,这也许是服务器配置问题呢? –

回答

1

在.htaccess文件尝试下DOCUMENT_ROOT这个代码:

Options +FollowSymlinks -MultiViews 
RewriteEngine on 
RewriteCond %{SERVER_PORT} =443 
RewriteRule . http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] 
+0

谢谢,但也没有工作要么 –

+0

嗯,你能告诉我这个请求的Apache的access.log吗? – anubhava

0

首先的;您的网站是否在HTTPS上正常运行?如是;那么给定的代码应该可以正常工作,从HTTPS重定向到http版本。