I have Drupal 4.7 running on Fedora 4, but I'm running into a problem with rewriting URLs. Because Apache performance can be affected by .htaccess directives, I put all the .htaccess sample information in the httpd.conf file (actually a vhost).

But it only works properly when I comment out the "RewriteRule" line below. If not commented out, I get the full Drupal frame, header and left and right sides, but no stories - instead it says "Page not found". (As mentioned elsewhere in the forums, the / before index.php is necessary so Apache doesn't return an error.)

# 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]
RewriteLogLevel 3
RewriteLog "/var/log/httpd/indymoms/rewrite.log"

Anybody seen and resolved this? The rewrite log doesn't offer a clue, nor does the server error log.

Comments

mo6’s picture

You did put the directives between an Directory directive, did you? The Apache rewrite module is enabled? RewriteEngine enabled?

I'm using the following (which works):

<Directory /srv/www/vhosts/domain.cxm/httpdocs>
<IfModule mod_rewrite.c>
  RewriteEngine on

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
</Directory>
gtorino’s picture

Thanks, that seems to work except it doesn't rewrite. It's still using ?q=

mo6’s picture

It's still using ?q=

Did you enable the "clean url" option in Drupal (admin/settings)?

gtorino’s picture

Silly me. That worked, thanks!