Jun 11, 2012, by admin
Here we will try to explain how you can enable the clean URLs in Drupal in three simple steps.
There are only 3 steps you need to follow to enable the Search Engine Friendly URLs.Here we assume that you already have Drupal installation for your account into the /drupal subfolder (www.yourdomainname.com/drupal) and you want to activate the clean URLs.
Step 1: Edit the .htaccess file in your Drupal directory.
Delete the entire content of the .htaccess file and insert the following lines into it:
RewriteEngine on
RewriteBase /drupal
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
You should replace the path in the following line:
RewriteBase /drupal
with the relative path to the directory where Drupal is installed. For example if your Drupal is installed in your web site root folder and you access it via www.yourdomainname.com, the line should look like this:
RewriteBase /
Please note that the rewrite rules are set by default in the Drupal 6.x installation package. All you have to do is verify the RewriteBase setting.
Step 2: The next step is to log in the administrative back end of your Drupal site and make sure that the “Path” module is enabled. This module is essential for the clean URLs in Drupal. Once you are logged click on the “Modules” link:
Scroll down the page, find the Path module, tick the little check box on the left of the module and save the settings:
Step 3: The next and final step is to test the clean URLs and confirm their functionality. In the administrative back end click on the Configuration link from the top menu and open the Clean URLs section.
The page will be loaded. Make sure that the clean URLs checkbox is enabled and the configuration is saved.
Now load the front end of your site and point the mouse over a link. In the status bar and in the address bar you will notice that all links will be in clean (human readable) format.