You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jeffery Cann <jc...@tourneysoft.com> on 2003/08/01 01:03:20 UTC

[users@httpd] Confused on RedirectMatch http to https

Hello.

I have been trying to get a redirect match to work.  I'm running the
following components:

Apache/2.0.46 (Unix) 
mod_ssl/2.0.46 
OpenSSL/0.9.7a 
mod_jk/1.2.2

All requests for /webapp/s/* should be redirected from HTTP to HTTPS. 
The goal here is to make sure no one can access any page under
/webapp/s/ via HTTP - must use HTTPS.

I have tried a few regexps and I seem to be missing some key piece of 
information because ones that I think should match do not.  I don't think it 
matters (maybe), but the /webapp/s/ is serviced by tomcat via mod_jk -- I 
have it all working just dandy under HTTP or
HTTPS.

First, I tried this to confirm that redirect match works (it does)
    RedirectMatch (.*) https://localhost/webapp/s/index.jsp

So I have tried various match expressions:

  RedirectMatch ^/webapp/s/(.*) https://localhost/webapp/s/$1
  RedirectMatch /webapp/s/(.*) https://localhost/webapp/s/$1
  RedirectMatch .*/webapp/s/(.*) https://localhost/webapp/s/$1

Other questions:  
0) Is mod_jk somehow affecting this problem?  I am not sure.  I am
assuming that redirects should happen before the request gets
forwarded.  Maybe this is my problem?
1) How can I get debug log output for RedirectMatch?  I set LogLevel debug in 
my httpd.conf and this didn't seem to trigger any logging.
2) Is my problem better (more easily) solved using mod_rewrite?
3) Do it make sense to add a deny rule for /webapp/s/ in my port 80
virtual host?

I appreciate any suggestions.
Jeff

---------------------------------------------------------------------
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] Confused on RedirectMatch http to https

Posted by DvDmanDT <dv...@telia.com>.
Make sure AddModule mod_jk.c is under the module that you use as alias and
under AddModule mod_rewrite.c... Yes, mod_jk could be causing it as it might
have filenametranslation in it..
// DvDmanDT
MSN: dvdmandt@hotmail.com
Mail: dvdmandt@telia.com
----- Original Message ----- 
From: "Jeffery Cann" <jc...@tourneysoft.com>
To: <us...@httpd.apache.org>
Sent: Friday, August 01, 2003 1:03 AM
Subject: [users@httpd] Confused on RedirectMatch http to https


> Hello.
>
> I have been trying to get a redirect match to work.  I'm running the
> following components:
>
> Apache/2.0.46 (Unix)
> mod_ssl/2.0.46
> OpenSSL/0.9.7a
> mod_jk/1.2.2
>
> All requests for /webapp/s/* should be redirected from HTTP to HTTPS.
> The goal here is to make sure no one can access any page under
> /webapp/s/ via HTTP - must use HTTPS.
>
> I have tried a few regexps and I seem to be missing some key piece of
> information because ones that I think should match do not.  I don't think
it
> matters (maybe), but the /webapp/s/ is serviced by tomcat via mod_jk -- I
> have it all working just dandy under HTTP or
> HTTPS.
>
> First, I tried this to confirm that redirect match works (it does)
>     RedirectMatch (.*) https://localhost/webapp/s/index.jsp
>
> So I have tried various match expressions:
>
>   RedirectMatch ^/webapp/s/(.*) https://localhost/webapp/s/$1
>   RedirectMatch /webapp/s/(.*) https://localhost/webapp/s/$1
>   RedirectMatch .*/webapp/s/(.*) https://localhost/webapp/s/$1
>
> Other questions:
> 0) Is mod_jk somehow affecting this problem?  I am not sure.  I am
> assuming that redirects should happen before the request gets
> forwarded.  Maybe this is my problem?
> 1) How can I get debug log output for RedirectMatch?  I set LogLevel debug
in
> my httpd.conf and this didn't seem to trigger any logging.
> 2) Is my problem better (more easily) solved using mod_rewrite?
> 3) Do it make sense to add a deny rule for /webapp/s/ in my port 80
> virtual host?
>
> I appreciate any suggestions.
> Jeff
>
> ---------------------------------------------------------------------
> 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
>


---------------------------------------------------------------------
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] Confused on RedirectMatch http to https

Posted by DvDmanDT <dv...@telia.com>.
Also, there's a directive to force SSL, you could use it and then use the
errordoc to get the user to https://whatever... Use a link, a javascript and
a meta tag... This should take care of it...
// DvDmanDT
MSN: dvdmandt@hotmail.com
Mail: dvdmandt@telia.com
----- Original Message ----- 
From: "Jeffery Cann" <jc...@tourneysoft.com>
To: <us...@httpd.apache.org>
Sent: Friday, August 01, 2003 1:03 AM
Subject: [users@httpd] Confused on RedirectMatch http to https


> Hello.
>
> I have been trying to get a redirect match to work.  I'm running the
> following components:
>
> Apache/2.0.46 (Unix)
> mod_ssl/2.0.46
> OpenSSL/0.9.7a
> mod_jk/1.2.2
>
> All requests for /webapp/s/* should be redirected from HTTP to HTTPS.
> The goal here is to make sure no one can access any page under
> /webapp/s/ via HTTP - must use HTTPS.
>
> I have tried a few regexps and I seem to be missing some key piece of
> information because ones that I think should match do not.  I don't think
it
> matters (maybe), but the /webapp/s/ is serviced by tomcat via mod_jk -- I
> have it all working just dandy under HTTP or
> HTTPS.
>
> First, I tried this to confirm that redirect match works (it does)
>     RedirectMatch (.*) https://localhost/webapp/s/index.jsp
>
> So I have tried various match expressions:
>
>   RedirectMatch ^/webapp/s/(.*) https://localhost/webapp/s/$1
>   RedirectMatch /webapp/s/(.*) https://localhost/webapp/s/$1
>   RedirectMatch .*/webapp/s/(.*) https://localhost/webapp/s/$1
>
> Other questions:
> 0) Is mod_jk somehow affecting this problem?  I am not sure.  I am
> assuming that redirects should happen before the request gets
> forwarded.  Maybe this is my problem?
> 1) How can I get debug log output for RedirectMatch?  I set LogLevel debug
in
> my httpd.conf and this didn't seem to trigger any logging.
> 2) Is my problem better (more easily) solved using mod_rewrite?
> 3) Do it make sense to add a deny rule for /webapp/s/ in my port 80
> virtual host?
>
> I appreciate any suggestions.
> Jeff
>
> ---------------------------------------------------------------------
> 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
>


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