I have worked around by setting an environment variable RewriteEngine on RewriteRule ^$ /test/home.php [NC,QSA,END,E=IS_DIR_INDEX:1] FallbackResource /test/fallback.php
<If "env('IS_DIR_INDEX') == 1"> SetHandler default_handler </If> On Sun, Jul 28, 2013 at 1:21 PM, Joyce Babu <jo...@joycebabu.com> wrote: > When SetHandler application/x-httpd-php is used, all files (including > images) are served as text/html. > > > > On Sun, Jul 28, 2013 at 1:05 PM, Joyce Babu <jo...@joycebabu.com> wrote: > >> >> On Sat, Jul 27, 2013 at 10:33 PM, Eric Covener <cove...@gmail.com> wrote: >> >>> Just occurred to me that just NS flag may be enough too. >>> >> >> It didn't work. According to the manual, NS flag will only prevent the >> rules from being applied on sub requests. >> >> >>> On Sat, Jul 27, 2013 at 11:49 AM, Eric Covener <cove...@gmail.com> >>> wrote: >>> > >>> > My recollection is that END is designed to prevent looping from >>> > rewrites own re-injection method during per-directory rewrites, which >>> > differs from how mod_dir and mod_negotiation internally lookup and >>> > then replace/redirect the active request. >>> > >>> > The method used by END does not propagate to those subrequests -- very >>> > little does. But maybe it would be possible for mod_rewrite to reach >>> > back, but I think it may require a new flag as some subrequests are >>> > not replacing the current request. >>> >> >> You are right. I tried disabling DirectoryIndex, and it worked correctly. >> It is not passed to FallbackResource too. >> >> >>> > I have a suspicion that maybe the 2.4 difference is related to not >>> > having a default type anymore. It is quite a roundabout influence, but >>> > you could maybe see if ForceType or SetHandler makes some kind of >>> > difference if it's active on that context? >>> >> >> SetHandler application/x-httpd-php worked. The file is being served >> correctly, even though a sub request is still being issued for the >> directory index file. Should I report this as a bug in mod_dir/mod_rewrite? >> >> Thanks, >> Joyce Babu >> > >