将HTTPSredirect到HTTP

问题:我无法让我的网站从httpsredirect到http。

好的,这里提供了一些解决scheme,但没有一个似乎为我工作。 为了build立一些东西,我已经有了.htaccess在这个网站上工作得很好,所以需要设置AllowOverride的方式。

我所看到的最基本的东西是添加如下内容:

RewriteEngine On RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} 

…到我的.htaccess文件。 然而,这并没有什么好处,就好像病情没有得到满足。 设置后,访问https://mysite.com我没有redirect到http://mysite.com,因为我期望,而只是通过https://mysite.com 。

这是什么原因? 我的期望是,以上在我的.htaccess文件和.htaccess文件在我的网站上正常工作,当我访问任何httpsurl时,我将被redirect到它的http等效。


更多信息

在临时服务器上在我的登台服务器上添加上面的htaccess发送给我一个URL的参数附加到它像http://mystaging-site.com/?ysid=2pnd073423ra966tihf22rfr9a2

在Prod服务器上生产的快速testing结果在一个Apache错误页面,说该页面已被移动,并有500服务器错误。

错误消息的具体内容是:

 Found The document has moved here. <--- this link simply points to the same page I am already on Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. 

这里是现有的htaccess:

 # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} !^www.mysite.com [NC] RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress 

而下面的失败:

 # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} =on //(with or without the equals symbol this fails) RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} RewriteCond %{HTTP_HOST} !^www.mysite.com [NC] RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress 

closures,但不完全,尝试:

 RewriteEngine On RewriteCond %{HTTPS} =on RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [L,R=301]