Forum Moderators: phranque

Message Too Old, No Replies

problem with mod rewrite local rewrite

problem with mod_rewrite local rewrite

         

shrutijkulkarni

10:02 am on Dec 15, 2009 (gmt 0)

10+ Year Member



Hi all,

I'm facing an issue with internal (local) rewrites. The very basic rewrite rule I have is:

---------------

RewriteEngine on
RewriteLog "/myfolder/apache2/logs/mod_rewrite.log"
RewriteLogLevel 9

RewriteRule ^/one /two/three.html

---------------

I have the three.html under my apache2/htdocs/two/three.html
The http response my browser gets back is 400: bad request

The rewrite logs are:

::1 - - [15/Dec/2009:15:08:02 +051800] [localhost/sid#80daa0][rid#904650/initial] (2) init rewrite engine with requested uri /one/
::1 - - [15/Dec/2009:15:08:02 +051800] [localhost/sid#80daa0][rid#904650/initial] (3) applying pattern '^/one' to uri '/one/'
::1 - - [15/Dec/2009:15:08:02 +051800] [localhost/sid#80daa0][rid#904650/initial] (2) rewrite '/one/' -> '/two/three.html'
::1 - - [15/Dec/2009:15:08:02 +051800] [localhost/sid#80daa0][rid#904650/initial] (2) local path result: /two/three.html
::1 - - [15/Dec/2009:15:08:02 +051800] [localhost/sid#80daa0][rid#904650/initial] (2) prefixed with document_root to /myfolder/apache2/htdocs/two/three.html
::1 - - [15/Dec/2009:15:08:02 +051800] [localhost/sid#80daa0][rid#904650/initial] (1) go-ahead with /myfolder/apache2/htdocs/two/three.html [OK]

--------------------

The same works with external redirect: say:

RewriteRule ^/one /two/three.html [R]

Really cant figure out whats wrong! any pointers will be of great help!

Thanks,
Shruti

shrutijkulkarni

11:52 am on Dec 15, 2009 (gmt 0)

10+ Year Member



oops.. i figured out what the problem was... my mod_jk config was overriding the rewrite rule and was redirecting it to tomcat which was causing a 400....