Enabling "Clean URLs" for Drupal on a SuSE 10.0 / Plesk 8 Box

Blog Topics:

Everyone and especially the search engines prefer clean URLs, such as you can see on this site. When you originally install Drupal, it uses URLs with a question mark. In the administrative section there's a test for checking whether your web server can support clean URLs. If it can't, here's what to do:

Open /etc/sysconfig/apache2 in your editor, look for the line starting with APACHE_MODULES=, and add rewrite to the list of Apache modules that your web server loads.

Edit /srv/www/vhosts/example.com/conf/vhost.conf and insert the following lines at the top of the file:

#
# Enable clean URLs
#
<Directory "/srv/www/vhosts/example.com/httpdocs">
AllowOverride All
</Directory>

While you're editing /srv/www/vhosts/example.com/conf/vhost.conf you may as well also add

php_admin_value max_execution_time 600

to the two Drupal sections. We hope our web server will never take 10 minutes for a request, but the default of half a minute just might be too short.

Finally, restart Apache:

/etc/init.d/apache2 restart

Retry the Drupal Clean URLs test, and it should pass this time, so you can enable them now.