Clean URLs in Drupal (Suse Linux)

Ugh. What a mess. This is such a pain. I hope that my experience will save somebody some trouble.

First. My main goal was to set up clean urls for Drupal without using the .htaccess file. This isn't as flexible, (you have to have access to the httpd.conf file, and you must restart your Apache server after changes), but its much faster.

The following links helped me get started:
Clean URLs - This page got me started, and got Clean URLs working to a degree, but it was rewriting .css, .js, and image file requests improperly.
Example Clean URL configuration of httpd.conf for performance - This gave me the rule that I needed to get everything working perfectly. You could almost ignore the one above and use this.

I'm running Suse 11.0 with the latest version of Apache. The way I applied this information, was I created a file called drupal_clean_urls.conf in '/etc/apache2/' with the following:

#RewriteLog "/tmp/rewrite.log"
#RewriteLogLevel 9
<Directory /srv/www/vhosts/drupal>
  RewriteEngine on
  RewriteCond  %{REQUEST_FILENAME} !^/$
  RewriteCond  %{REQUEST_FILENAME} !^/(files|misc|uploads)(/.*)?
  RewriteCond  %{REQUEST_FILENAME} !\.(php|ico|png|jpg|gif|css|js|html?)(\W.*)?
  RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
</Directory>

'/srv/www/vhosts/drupal' is where I installed Drupal. This is where my vhosts file points my domains to, and is my web root directory for my domains.

I then added the following to my vhosts file:

Include /etc/apache2/drupal_clean_urls.conf

This shows Apache where this special configuration is.

If you'd like to see what mod_rewrite is doing behind the scenes, uncomment the RewriteLog directives and check out the '/tmp/rewrite.log' file. Its kinda hard to read, but it helped me out a bunch.

If you're nuts, and want more info on how to do mod_rewrite rules, visit Apache's webiste.
mod_rewrite