[CLUE-Tech] Help with apache RedirectMatch

Jeffery Cann fabian at jefferycann.com
Sat Jul 26 08:35:06 MDT 2003


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 myriad of 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 the application working through mod_jk 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

I am assuming from this statement from the manual "The supplied
regular expression is matched against the URL-path,..." that URL-path
is everything after http://{server}/.  So, I'm not sure why any of the above 
does not match

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?
2) Is my problem better (more easily) solved using mod_rewrite?
3) Do I need some sort of deny rule for /webapp/s/ in my port 80
virtual host (HTTP)?

I appreciate any suggestions.
Jeff 
-- 
"Keep yourselves far from every form of exaggerated nationalism, racism and 
intolerance."
-- Pope John Paul II 



More information about the clue-tech mailing list