Forum Moderators: phranque
A snip of my http.conf:
RewriteEngine on
RewriteLog logs/rewrite.log
RewriteLogLevel 9
RewriteCond %{REQUEST_URI}!-U
RewriteRule ^(.+) [server2...] [R,L]
Relevant rewrite.log bits:
10.122.21.147 - - [06/Feb/2006:01:14:23 --0500] [server1/sid#25c148][rid#5c8158/initial] (2) init rewrite engine with requested uri /api
10.122.21.147 - - [06/Feb/2006:01:14:23 --0500] [server1/sid#25c148][rid#5c8158/initial] (3) applying pattern '^(.+)' to uri '/api'
10.122.21.147 - - [06/Feb/2006:01:14:23 --0500] [server1/sid#25c148][rid#5c4060/subreq] (2) init rewrite engine with requested uri /api
10.122.21.147 - - [06/Feb/2006:01:14:23 --0500] [server1/sid#25c148][rid#5c4060/subreq] (1) pass through /api
10.122.21.147 - - [06/Feb/2006:01:14:23 --0500] [server1/sid#25c148][rid#5c8158/initial] (5) RewriteCond URI (-U) check: path=/api -> status=200
10.122.21.147 - - [06/Feb/2006:01:14:23 --0500] [server1/sid#25c148][rid#5c8158/initial] (4) RewriteCond: input='/api' pattern='!-U' => not-matched
10.122.21.147 - - [06/Feb/2006:01:14:23 --0500] [server1/sid#25c148][rid#5c8158/initial] (1) pass through /api
As you can see I get a 200 status OK for the api uri even though I end up getting a 404 back from apache when I surf there (it tries to still pull it up from server1). I've been googling around for a bit and have found one or two posts suggesting something to do with the way subrequests work but no real solution.
This is Apache 2.0.55 on Windows Server 2003 by the way.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+) http://server2.com/$1 [R=301,L]
RewriteEngine on
RewriteRule ^(.+) http://server2.com/$1?Filename=%{REQUEST_FILENAME} [R=301,L]
[edit] Clarified wording on temporary test rule. [/edit]
[edited by: jdMorgan at 2:56 am (utc) on Feb. 7, 2006]