Re: [users@httpd] Switching between HTTP and HTTPS using Rewrite Module, where Mod Proxy used for other purpose.

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

 



Hello,

On 6/15/06, Anil Dighade <danil@xxxxxxxxxxxxxxxx> wrote:

I am trying to Switch protocol between HTTP and HTTPS using Rewrite Module. Little background before I start problem. I use Apache as web sever(on 182.24.116.157)  and Weblogic(on 182.24.226.59)  as application sever. So all my code deployed in weblogic server. Apache simply redirects the request. I access site as http://182.24.116.157:7333/godzilla/ where "godzilla" is name of deployed .war file in weblogic To enable switching between HTTP and HTTPS I used below rewrite rule but this isn't working. I want to redirect all the pages which start with "isc" on to HTTPS for example below

http://182.24.116.157:7333/godzilla/iscmypage should be rewritten as https://182.24.116.157:7334/godzilla/iscmypage



For HTTP Virtual Host

RewriteEngine on

RewriteRule ^/godzilla$ http://182.24.116.157:7333/godzilla/     # Here also tried ^godzilla$

RewriteRule ^/godzilla/(isc\.*)$ https://182.24.116.157:7334/godzilla/$1 [L] # Here also tried removed preceding /

RewriteRule ^/godzilla/(.*)$ http://182.24.116.157:7333/godzilla/$1 [P,L] # Here also tried removed preceding /


You indicate above you want a redirect, ie, a browser accessing
http://182.24.116.157:7333/godzilla/iscmypage should be told to access
https://182.24.116.157:7334/godzilla/iscmypage in stead. Am i correct?

You can do this several ways. One is with a rewrite rule, but you need
to add the R flag. Like this:
RewriteRule ^/godzilla/(isc\.*)$ https://182.24.116.157:7334/godzilla/$1 [R]

This will cause the server to send a redirect response to the browser.

Another way is to use the  Redirect directive:

RedirectMatch /godzilla/(isc\.*)$ https://182.24.116.157:7334/godzilla/$1

You http config btw contains a lot that is (in my opinion) unecessary.

- You cannot have ssl namevirtualhosts
- You have alias and proxy statements for the same URLs. What do you
want your server to do?

So try to simplify your httpd.config somewhat.
- Since your app lives on another server you certainly don't need the
"Alias /Godzilla/ ... " lines.
- You only need the redirect or rewrite statement in your http host,
not in your https host.
- The proxy statements you only want in the https host, not in your http host.

HTH,

Krist

--
krist.vanbesien@xxxxxxxxx
Bremgarten b. Bern, Switzerland

---------------------------------------------------------------------
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