Mod_rewrite problem in Apache

My companies website CSA Travel Protection has been using IIS to talk with Tomcat to host our jsp’s. We bought Helicon’s ISAPI Rewrite software to perform rewrites of our url. As of late we are looking to get IIS out of the picture and switch to Apache instead. In a test environment, I was having problems getting the Mod_rewrite to work properly. The way Helicon and Mod_Rewrite interpret the formatting is slightly different from each other. I was simply trying to do a simple rewrite like this:

# Employment
RewriteRule ^/partner$ /

This was causing the message in the rewrite log file to be:

[rid#7d3160/initial] (2) rewrite /partner -> / – – [11/May/2006:14:36:08 –0700] [][rid#7d3160/initial] (3) split uri=/ -> uri=/, args=pmode=partner – – [11/May/2006:14:36:08 –0700] [][rid#7d3160/initial] (2) local path result: / – – [11/May/2006:14:36:08 –0700] [][rid#7d3160/initial] (2) prefixed with document_root to C:/jakarta-tomcat-5.5.12/webapps/csa/ – – [11/May/2006:14:36:08 –0700] [][rid#7d3160/initial] (1) go-ahead with C:/jakarta-tomcat-5.5.12/webapps/csa/ [OK]

It seems as if I have to pass through the rewritten URL to Tomcat and need to use the PT Passthrough flag.
# Employment
RewriteRule ^/employment$ / [NC,PT]

This has allowed me to migrate from Helicon’s ISAPI Rewrite to Apache’s Mod_Rewrite.

1 Comment on “Mod_rewrite problem in Apache

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.