Google Groups
Subscribe to Software Outsourcing [ Hire Dedicated Group ]
Email:
Visit this group

Thursday, April 17, 2008

Drupal 5, clean URLs, and Fedora

Monkeying around with Drupal 5 on Fedora 8, trying to get up to speed in this strange new world of structureless node soup. I thought an easy warmup task would be to get clean URLs working, but that turned out to be quite a tussle.
I had Drupal installed in a "/drupal" subdirectory of an existing site, which worked fine as long as the Apache config had Alias /drupal /usr/share/drupal, which was installed by default. That made everything work, but putting in the default "clean URLs" rewrite rules and trying to access the "admin/settings/clean-urls" URL (instead of "?q=admin/settings/clean-urls") gave this error in the Apache config:
The requested URL /usr/share/drupal/index.php was not found on this server.
Assuming that's the googleable phrase that will land folks here, here was my solution: first, realize that the Alias of /usr/share/drupal was preventing the rewrite rules from ever being accessed - remove the rewrite rules and you'll see you get the same error. I ended up removing the Alias altogether, and instead making a symlink inside my web root to /usr/share/drupal. Then just add your rewrite rules and an option to follow symlinks in a Directory config for your web root, like so:
Options FollowSymLinks
RewriteEngine on
RewriteBase /drupal
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


And don't forget to remove the Alias /drupal /usr/share/drupal line from your config. Do that, and it should work. Works for me, at least.

Source: frobnosticate.com