[SATLUG] Re: When rewrite doesn't

K. Spoon kell at spoonix.com
Fri Feb 2 13:35:18 CST 2007


On Thu, Feb 01, 2007 at 10:59:32PM -0600, Mike wrote:
> Now, let's say that I would rather that directory/subdir be the path to map
> instead of just plain ol directory.  In that case, I'll replace the above
> rule with the following.
> 
> RewriteRule ^/directory/subdir($|/.*) \
> http://127.0.0.1:8080/VirtualHostBase/\
> http/{SERVER_NAME}:80/stuff/VirtualHostRoot/_vh_directory/_vh_subdir$1 [L,P]

Are you sure that's correct?  The "_vh_subdir" part?  Shouldn't that
just be "subdir", or is there truly a _vh_subdir in the real, physical
path?

If not, that could explain what's happening.  Apache is matching the
request, but it is sending back a 404 because the target doesn't exist.
Since you told it to proxy the request with the "P" flag, it won't show
you the URL it's rewriting to, either... for testing purposes (both to
verify that the rewrite is working and that it's sending the browser to
the right place) you might want to drop that temporarily.

-- 
K. Spoon <kell at spoonix.com>


More information about the SATLUG mailing list