httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Kalu┼ża <>
Subject [PATCH] mod_rewrite, mod_dir and RewriteRule ^$
Date Fri, 13 Sep 2013 06:00:26 GMT

I was trying to examine and fix PR 53929. The problem is that rewrite 
rule "RewriteRule ^$ /index-cached.html [L]" with "GET /" worked as 
expected in httpd-2.2, but in httpd-2.4 it does not because of following 
mod_dir commit: <>.

This commit was originally trying to fix PR 25435, but it does not fix 
this PR completely. Proper fix is described in PR 25435, but the patch 
is not implemented and the proposed solution with SetDirHandler and 
SetFileHandler is not acceptable for 2.4 probably.

I'm trying to fix PR 53929 with attached patch. Normally r->uri and 
r->filename ends with "/" in the case of directory request. If 
mod_rewrite rewrites URL in hook_fixup, it changes r->filename. In this 
patch, I check if the r->filename still ends with "/" and if not, return 
DECLINED in mod_dir fixup hook.

However, I think there is still problem if you rewrite r->filename from 
directory to directory, but it should fix case when you rewrite from 
directory to file. I don't see immediate solution for directory to 
directory rewrite, so any help is welcome.

I have tested the patch and run test-suite without noticing any regression.

Jan Kaluza

View raw message