After attempting to create a custom rewrite rule that had nothing to do with drupal, I noticed that the following rules in the default .htaccess file were being too greedy and seemingly matching every URL provided:
# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
as near as I can determine, the problem arose from the fact that my custom rewrite was dealing with a cgi. Specifically, I was attempting to rewrite a URL of the form:
http://domain.tld/finger/username
to the form
http://domain.tld/cgi-bin/finger.pl?user=username
but it wasn't working.
After beating my head against it for a couple hours, I discovered that mod_rewrite can be set to log what it's doing, which is when I found the overly greedy rules.
The fix (or at least the fix I discovered) is to add the following line to that section of the .htaccess file:
RewriteCond %{REQUEST_FILENAME} !.*cgi-bin.*
which says, in essence, "any URI that contains the string 'cgi-bin' is exempt from the following RewriteRule"
I've included a "patch" containing this change. Rewriting URLs for cgi's is a pretty common thing to do, can someone please verify this issue?
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | htaccess_3.patch | 375 bytes | davek@davekaufman.net |
Comments
Comment #1
davek@davekaufman.net commentedThe patch in question.
Comment #2
morbus iffWon't fix. We can't cater to every user installation possible, and guessing at a thousand exclusions of possible directories is foolish.
Comment #3
morbus iff