Drupal, Clean URLs
By default, Drupal generates and uses site page URLs in a specific style that may prevent some search engines from indexing all the pages of your site. The following is an example of the default URL used by Drupal:
http://www.example.com/?q=node/42
If the default URLs in Drupal are not what you had in mind for your site, you can tell Drupal to use Clean URLs which remove the "?q=" from your site's URLs and cleans up your domain.
Enabling the Clean URLs in Drupal
Enabling the use of Clean URLs in Drupal is a very simple process; however, enabling this feature within your specific version of Drupal may vary. Please refer to the proper version of your Drupal installation below.
Drupal 7.x
During the installation of Drupal 7, the environment is tested for Clean URLs compatibility. If the environment is compatible, Clean URLs will be enabled automatically with no further action necessary from the user. If the environment is found incompatible, Clean URLs can be enabled post-installation using the instructions below:
- Log into your Drupal Admin page.
- Click on the Administer link.
- Select Configuration.
- Choose Search and Metadata.
- Wait for the automated test to complete.
- Check the Enable Clean URLs checkbox.
- Click the Save Configuration button.
Drupal 6.x
In Drupal 6, the installer tests for compatibility with Clean URLs as a part of the installation process. If the installer was not able to run the test successfully at the time of installation, you can follow the instructions below to manually enable Clean URLs.
- Log into your Drupal Admin page.
- Click on the Administer link.
- Choose the Site Configuration option.
- Click the Clean URLs link.
- When you navigate to the Clean URLs configuration page, Drupal 6 will run the Clean URLs test automatically and show the results.
- Toggle the Clean URLs to enabled.
- Click the Save Configuration button.
Configuration for Dedicated Servers
Even if Clean URLs is successfully enabled at install time, Dedicated Server users may need to edit the httpd.conf files to enable a more efficient rewrite method for Clean URLs. In order to do so, you will need to complete the steps below:- Enable mod_rewrite. For help enabling mod_rewrite, please refer to the following article:
- Locate the appropriate Apache configuration file for your site.
- Copy or include the Drupal-specific settings directly into your configuration file.
For more detailed instructions on server configuration for Clean URLs, please see Drupal's documentation at the following link in the section titled "Server Configuration for Clean URLs on a Dedicated Server with httpd.conf."