How-to Enable Clean URL’s in Drupal 5
![]()
Oy vey, getting clean URL's to work in Drupal has been a bitch, but we finally got it and I'll share how to do it!
We have a Drupal site we just moved to the production server, which is on Media Temple. Media Temple has Apache's mod_rewrite enabled by default, which is really sweet.
(You NEED mod-rewrite in order to do clean URL's. If your server won't let you, move!)
For Drupal there are two things you need to do, the first of which is modifying the .htaccess file. Media Temple gives you some clues in this knowledgebase article, but it's not quite what we need for Drupal.
Create a file named '.htaccess' in the main Web directory where Drupal resides. F'rinstance, if your drupal site is at www.site.com/drupal, .htaccess should be at www.site.com/drupal/.htaccess. (More than likely it'll just need to be at www.site.com/.htaccess however.)
Add the following to .htaccess:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond\n%{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Ok, then. Now open up your settings.php file. This is usually at /sites/default/settings.php. (Or it may be at /sites/all/settings.php). Crank that puppy open and at the very bottom add this line:
$conf['clean_url'] = 1;
Go to your admin area and enable clean URL's (it's at http://yoursite.com?q=admin/settings/clean-urls).
It's that easy! Of course, it took me over an hour to figure that out, and it shouldn't have been that difficult. That's why I'm sharing with you. I know, I know, I'm a nice guy, keep that praise coming.
All the best of luck with your clean URL-enabling and Drupal installs!
It seems to me that better
Yes, that would be
There is a lionk on that
Right, that may work for
Drupal comes with an
Weird ...I thought there was
It's ls -a not ls -l to view
Thank you, sir, you are
I tried following the
I just installed Drupal 6.1
Right, that may work for