RE: Redirect HTTPS --> HTTP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Krist,

Every option I have tried has had no effect on changing the url back to
http from https so far.  

The latest is this:

RewriteCond {SERVER_PORT} !=81
RewriteCond %{REQUEST_URI} ^/scripts/vendor/membership\.php$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

The above will write the http to https fine.

Then I try and change back to http:

RewriteCond {SERVER_PORT} =81
RewriteCond %{REQUEST_URI} !^/scripts/membership\.php$
RewriteRule ^.*$ http://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

I have tried with and without the SERVER_PORT directive, I have tried
using {SERVER_PORT} !=80, and also without server_port./

Results in rewrite log level 2 are this:

70.104.12.9 - - [30/Nov/2007:09:45:00 --0800]
[www.domain.com/sid#555555818a68][rid#555555b5df18/initial] (2) init
rewrite engine with requested uri /scripts/vendor/welcome.php
70.104.12.9 - - [30/Nov/2007:09:45:00 --0800] [www.
domain.com/sid#555555818a68][rid#555555b5df18/initial] (1) pass through
/scripts/vendor/welcome.php
70.104.12.9 - - [30/Nov/2007:09:45:01 --0800] [www.
domain.com/sid#555555818a68][rid#55555590ec38/initial] (2) init rewrite
engine with requested uri /resource/themes/default/css/learn.css.php
70.104.12.9 - - [30/Nov/2007:09:45:01 --0800] [www.
domain.com/sid#555555818a68][rid#55555590ec38/initial] (1) pass through
/resource/themes/default/css/learn.css.php
70.104.12.9 - - [30/Nov/2007:09:45:03 --0800] [www.
domain.com/sid#555555818a68][rid#5555563a68c8/initial] (2) init rewrite
engine with requested uri /scripts/vendor/blank.php
70.104.12.9 - - [30/Nov/2007:09:45:03 --0800] [www.
domain.com/sid#555555818a68][rid#5555563a68c8/initial] (1) pass through
/scripts/vendor/blank.php
70.104.12.9 - - [30/Nov/2007:09:45:03 --0800] [www.
domain.com/sid#555555818a68][rid#555555b5ee30/initial/redir#1] (2) init
rewrite engine with requested uri /error/HTTP_NOT_FOUND.html.var
70.104.12.9 - - [30/Nov/2007:09:45:03 --0800] [www.
domain.com/sid#555555818a68][rid#555555b5ee30/initial/redir#1] (1) pass
through /error/HTTP_NOT_FOUND.html.var
70.104.12.9 - - [30/Nov/2007:09:45:03 --0800] [www.
domain.com/sid#555555818a68][rid#555555a2dbd8/subreq] (2) init rewrite
engine with requested uri /error/include/top.html
70.104.12.9 - - [30/Nov/2007:09:45:03 --0800] [www.
domain.com/sid#555555818a68][rid#555555a2dbd8/subreq] (1) pass through
/error/include/top.html
70.104.12.9 - - [30/Nov/2007:09:45:03 --0800] [www.
domain.com/sid#555555818a68][rid#555555e810e8/subreq] (2) init rewrite
engine with requested uri /error/include/bottom.html
70.104.12.9 - - [30/Nov/2007:09:45:03 --0800] [www.
domain.com/sid#555555818a68][rid#555555e810e8/subreq] (1) pass through
/error/include/bottom.html
70.104.12.9 - - [30/Nov/2007:09:45:03 --0800] [www.
domain.com/sid#555555818a68][rid#5555563b53a8/subreq] (2) init rewrite
engine with requested uri /error/contact.html.var
70.104.12.9 - - [30/Nov/2007:09:45:03 --0800] [www.
domain.com/sid#555555818a68][rid#5555563b53a8/subreq] (1) pass through
/error/contact.html.var
70.104.12.9 - - [30/Nov/2007:09:45:05 --0800] [www.
domain.com/sid#555555818a68][rid#555555a45418/initial] (2) init rewrite
engine with requested uri /scripts/vendor/bt.css
70.104.12.9 - - [30/Nov/2007:09:45:05 --0800] [www.
domain.com/sid#555555818a68][rid#555555a45418/initial] (1) pass through
/scripts/vendor/bt.css
70.104.12.9 - - [30/Nov/2007:09:45:05 --0800] [www.
domain.com/sid#555555818a68][rid#55555590f9f8/initial/redir#1] (2) init
rewrite engine with requested uri /error/HTTP_NOT_FOUND.html.var
70.104.12.9 - - [30/Nov/2007:09:45:05 --0800] [www.
domain.com/sid#555555818a68][rid#55555590f9f8/initial/redir#1] (1) pass
through /error/HTTP_NOT_FOUND.html.var
70.104.12.9 - - [30/Nov/2007:09:45:05 --0800] [www.
domain.com/sid#555555818a68][rid#555555a4d458/subreq] (2) init rewrite
engine with requested uri /error/include/top.html
70.104.12.9 - - [30/Nov/2007:09:45:05 --0800] [www.
domain.com/sid#555555818a68][rid#555555a4d458/subreq] (1) pass through
/error/include/top.html
70.104.12.9 - - [30/Nov/2007:09:45:05 --0800] [www.
domain.com/sid#555555818a68][rid#555555a3bc48/subreq] (2) init rewrite
engine with requested uri /error/include/bottom.html
70.104.12.9 - - [30/Nov/2007:09:45:05 --0800] [www.
domain.com/sid#555555818a68][rid#555555a3bc48/subreq] (1) pass through
/error/include/bottom.html
70.104.12.9 - - [30/Nov/2007:09:45:05 --0800] [www.
domain.com/sid#555555818a68][rid#555555a51478/subreq] (2) init rewrite
engine with requested uri /error/contact.html.var
70.104.12.9 - - [30/Nov/2007:09:45:05 --0800] [www.
domain.com/sid#555555818a68][rid#555555a51478/subreq] (1) pass through
/error/contact.html.var

Are there any clues as to why this wont work?  Is there anything else I
can check, raise the log level?

Thanks,

Matt


-----Original Message-----
From: Krist van Besien [mailto:krist.vanbesien@xxxxxxxxx] 
Sent: Wednesday, November 28, 2007 2:46 PM
To: users@xxxxxxxxxxxxxxxx
Subject: Re:  Redirect HTTPS --> HTTP

On Nov 28, 2007 9:10 PM, Matt Bullock <mbullock@xxxxxxxxx> wrote:

> I can't seem to get the rule to change the request back to http
though... any
> ideas?

First of all, you don't need the "RewriteCond {SERVER_PORT} !=80 " and
similar conditions, as your virtual host allready takes care of
shielding your rules for requests to the other port.

Secondly, if rules are not doing what you expect them to do, start by
enabling a rewritelog, with high enough rewriteloglevel. This will
give you tons of information, and if this still leaves you without a
solution you can always post excerpts from your rewrite log here on
the list.

Krist


-- 
krist.vanbesien@xxxxxxxxx
krist@xxxxxxxxxxxxx
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux