Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache + Tomcat + Rewrite

Status
Not open for further replies.

anuprm

Programmer
Nov 20, 2003
11
IN
Hi,

This is my situation. I have Apache 2.0.48, Tomcat 4.1 installed on a Win 2000 machine. I have set up mod_jk to redirect requests from Apache to Tomcat. I intend to use mod_rewrite to do some URL manipulations. When I try to use mod rewrite with just Apache it works fine, but when I use Apache + Tomcat it does not.

.htaccess file contains

RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^\.htaccess$ - [F]

In httpd.conf file I have added this line :
LoadModule jk2_module modules/mod_jk2.so to load the mod_jk module and used the workers2.properties file to redirect from Apache to Tomcat. Should I be doing anything else for mod_rewrite to work?

Thanx
 
Hi,

Check your Rewrite log file adding these lines to your
httpd.conf file. I'm sure that it will help you

RewriteLog "/usr/local/var/apache/logs/rewrite.log"
RewriteLogLevel 9

Luck
 
Hi!

I actually have the same "problem".

It's no problem to redirect whatever content you want to tomcat. And it's no problem to rewrite any url to any other url. Those things work fint.

Combining them however....

I need to rewrite calls like /get_that_stuff.htlm to /some.jsp?with=parameters. some.jsp should ofcourse be handled by tomcat but after rewriting the original request apache will happily send the .jsp source file.

With [R] it works but it rewrites the url which is just ugly.

Can I force apache to redo the entire requst but keeping the original url? Or call the .jsp in the background?

Any tips?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top