You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Peter Gordon <pe...@pg-consultants.com> on 2007/05/29 08:53:55 UTC

[users@httpd] Redirect https -> http

Server version: Apache/2.2.4 (Unix)
Server built:   Apr 22 2007 15:51:28


I have the following rule in httpd.conf. It forces redirection from http -> https and works correctly.

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]
RewriteLogLevel 9
RewriteLog "/var/log/rewrite.log"


I replaced the rules above with the following rules, which are meant to redirect https->http. 
It does not work. No redirect takes place and nothing is logged in the rewrite log file. When I use an https:/ url
it continues as an https url.

RewriteEngine On
RewriteCond %{HTTPS} !=off
RewriteRule ^/(.*) http://%{SERVER_NAME}/$1 [L,R]
RewriteLogLevel 9
RewriteLog "/var/log/rewrite.log"

Any help would be appreciated.

Peter


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Redirect https -> http

Posted by Joshua Slive <jo...@slive.ca>.
On 5/29/07, Peter Gordon <pe...@pg-consultants.com> wrote:

>
> I replaced the rules above with the following rules, which are meant to redirect https->http.
> It does not work. No redirect takes place and nothing is logged in the rewrite log file. When I use an https:/ url
> it continues as an https url.

The fact that nothing is in the RewriteLog implies that the rules
aren't even being considered for the request. This is likely happening
because ssl requests are being served out of a <VirtualHost> block. To
get the mod_rewrite stuff applied, you need to put
RewriteEngine On
RewriteOptions inherit
inside the ssl <VirtualHost> block.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org