problem:
(I'm guessing this falls into the filesystem category ... please feel free to move it if appropriate)
immediately following upgrade from 4.5.2 (2005.03.15) to 4.6.0 (on linux-apache-mysql-php server)
getting error 500 reports everytime I click a link (from the admin or home page).
The problem seems to lie about 3 or 4 lines from the end of the htaccess file: the ReWriteRule is missing a backslash preceding index.php.
it did look like this
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
it should look like this
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
in context, this is the end of the htaccess file, with the correction:
# 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]
</IfModule>
# $Id: .htaccess,v 1.66 2005/03/20 19:15:00 dries Exp $
A number of other solutions have been put forward for this recurring problem. I found this solution from a 4.4 issue at http://drupal.org/node/7836.
It seems to work just fine and is obviously preferable to disabling the Htaccess or ReWriteEngine and losing clean URLs.
good luck to y'all
JohnG
Comments
Comment #1
dries commentedWon't this break setups who run Drupal from a 'subdirectory' (http://example.com/~username/drupal/)?
How come no one else has this problem?
Without further details/support, I'm inclined to mark this "Won't fix".
Comment #2
chx commentedI won't fix this.
Here's why: you may need that / before index.php. Also, you may need a RewriteBase. It's just not possible to make a .htaccess which fits all webhosters. If your host is good then it will have a knowledgebase article on the subject. (I know mine has.)
Comment #3
JohnG-1 commentedFair enough - I admit I don't understand why this worked for me, and yes it is suprising that more people haven't had the problem if it was a bug.
Sorry if I was alarmist, but this was a 'critical' solution for my installation - and it seemed like such an easy patch!
I was also a bit dissatisfied with the frequently suggested: 'remove your htaccess file' - which seems like throwing the baby out with the bath water. I'm assuming that the htaccess file is useful for something or it wouldn't be there, and the ReWriteEngine is necessary for clean URLs which help search-engine indexing. Ergo, if you want the Searchengines to index your site, get your htaccess working.
On reflection, by submitting it as a 'patch' I didn't intend it as a revision or correction of the (cvs?) 'published' htaccess file. I may have misunderstood the Drupalese. I thought 'patch' implied a kind of optional or custom solution to be applied where needed.
My intention was to make this solution easily accessible to people who may be having the same problem, and did my best to make the title search-friendly.
As I say: I don't really understand the problem it fixed! I only happened upon it by laboriously trawling through the forums and trying it out with fingers crossed. Perhaps someone cleverer than me can explain why it works and in which circumstances ... perhaps then it could go somewhere in the documentation (like: http://drupal.org/node/9909).