Instructions originally from James Jacobs
Reviewed and Updated on 2012-05-03
From http://drupal.org/getting-started/clean-urls:
"By default, Drupal uses and generates URLs for your site's pages that look like "http://www.example.com/?q=node/83... If you are unhappy with the default URLs in Drupal, you may be able to tell Drupal to use "clean URLs", eliminating the "?q=" in your site's URLs"
To enable clean URLs, you'll need to modify the RewriteBase found in your .htaccess file (you'll need to do an "ls -la" command to see the .htaccess file in the drupal directory). The value you set it to will depend on the URL of your website.
.htaccess tweaks
www.stanford.edu
If your Drupal site is accessed from a www.stanford.edu address, you'll need to change the RewriteBase to show the AFS path to your drupal instance starting at group or dept. Look for the following lines:
# Modify the RewriteBase if you are using Drupal in a subdirectory and # the rewrite rules are not working properly. # RewriteBase /drupal
and uncomment (remove the #) and update the RewriteBase line. For example, if your site is installed in /group/ic/cgi-bin/drupal, you would change that line to:
# Modify the RewriteBase if you are using Drupal in a subdirectory and # the rewrite rules are not working properly. RewriteBase /group/ic/cgi-bin/drupal
Vanity URL
If your vanity URL is handled by the Reverse Proxy Servers, use the same instructions as above, as if your site was accessed through www.stanford.edu.
If your vanity URL is handled by the WWW's (most new vanity URLs are), look for the following lines:
# Modify the RewriteBase if you are using Drupal in a subdirectory and # the rewrite rules are not working properly. # RewriteBase /drupal
and uncomment (remove the #) and update the RewriteBase line, setting it to /
# Modify the RewriteBase if you are using Drupal in a subdirectory and # the rewrite rules are not working properly. RewriteBase /
Enabling Clean URLs
Go into your site's clean URLs admin section (admin/settings/clean-urls in Drupal 6, and admin/config/search/clean-urls in Drupal 7). Enable clean urls and save the configuration. If the option for enabling clean URLs is not available, make sure you have performed the above correctly. Drupal will show a message saying that your configuration does not support clean URLs until you do so.
That should do it for those nasty "?q=" characters.