Apache Server configuration support - Mod_Rewrite REQUEST_FILENAME and Default Pages - Change from Apache 1.3 to 2.0?

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > February 2006 > Mod_Rewrite REQUEST_FILENAME and Default Pages - Change from Apache 1.3 to 2.0?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Mod_Rewrite REQUEST_FILENAME and Default Pages - Change from Apache 1.3 to 2.0?
Ben Gribaudo

2006-02-13, 8:54 pm

Hi Folks,

We're upgrading from Apache 1.3 to 2.0 (2.0.54-5ubuntu4). Apparently,
between the two versions (or the way our installs are configured) a
change occured having to do with the population of mod_rewrite's
REQUEST_FILENAME variable.

Under Apache 1.3, if a visitor requests a path without specifying a
file name (i.e. example.com/abc/) and the requested folder contains a
directory index file (as specified by DirectoryIndex), by the time
mod_rewrite rules in .htaccess files are parsed, the directory index
file's name has been apphended to REQUEST_FILENAME.So, if the directory
index file's name is index.html, REQUEST_FILENAME would have
"index.html" tagged on the end.

This is not the case with our Apache 2.0 setup. The directory index
document name is *not* appended to REQUEST_FILENAME.

Example:
Apache 1.3--If the folder being requested ((i.e. example.com/abc/)
contained an index.gallery file (and that file is a DirectoryIndex),
these rules would work because index.gallery is added to
REQUEST_FILENAME :
RewriteCond %{REQUEST_FILENAME} -s
RewriteRule ^.*\.gallery?(.*)$ /some/path [L,QSA]

Apache 2.0--The above rules do not work because index.gallery is not
appended to REQUEST_FILENAME.

Do you have any ideas on how to adjust our Apache 2.0 config so that
the directory index file's name is appended to REQUEST_FILENAME? Or, is
there another mod_rewrite variable containing this information? Is this
a module load order issue?

Thank you,
Ben

Ben Gribaudo

2006-02-14, 6:02 pm

Thank you, Robert. LA-U didn't work with 2.0. -Ben


Robert Ionescu wrote:
> But as far as I cam remember this was changed again for the 2.2 branch.
> So you might try the new version of Apache or in 2.0
> %{LA-U:REQUEST_FILENAME} -s
> but I'm not sure, if this works. This performs a sub-request lookup for
> REQUEST_FILENAME.


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com