Two Kinds of People Think Too Much About Linux.
Those who Love it and those who Hate it !!!

I come under the first category .. What about you ???

About Me

My photo
A FOSS Enthusiast and a Great fan of Slackware, Sabayon ( KDE ) and Ubuntu. Like to develop apps and love to work with PHP and Databases. Love to solve the Rubik's Cube and can be seen listening to Telugu and Hindi songs when not messing with Linux or Solving the Cube.

Wednesday, May 5, 2010

Clean Urls on Drupal6

Hello friends, I recently installed Drupal6 on my machine which operates on Ubuntu 10.04. So this being pretty new , I also wanted to change from Drupal 5 on to Drupal6 on

I basically dont like the urls to be unidentifiable and hence wanted to enable Clean Urls feature as soon as I setup my Drupal6. 

But the thing was , my system was tested and Drupal6 dint support the feature. So after a bit of ( a lot of ) googling and understanding ... I found out this very simple hack / tweak that helps you enable the feature. 

So here it is ... enjoy ... 

First what you do is , check if the mod_rewrite is available or not in Apache2.
To check , please key in the following in the terminal
( Applications > Accessories > Terminal )

apache2ctl -M

*If you dont have Apache2 installed and just Apache installed , you can try this out as well.

apachectl -M

In the output, please check if the rewrite_module is included or not.

If it is not there in the list .. please leave this article and google around on " how to load the rewrite_module in Drupal6 " because though I have an idea ... I perfectly cant guide you through the process.

Update :
Just install the " rewrite_module" using the following command.

sudo a2enmod rewrite 

Then restart apache2 using the following command.

/etc/init.d/apache2 restart

So continuing with the step-by-step instructions ... The following command works to enable the module without editing any files:

a2enmod rewrite

We then have to restart Apache server

sudo /etc/init.d/apache2 restart

Then we move on to edit the htaccess file which can be done by using gedit.

sudo gedit /etc/drupal/6/htaccess

Then search for RewriteBase /drupal  to  RewriteBase /drupal6
Save the file and then restart Apache again.

Then move on to http://localhost/drupal6/?q=admin/settings/clean-urls and enable the Clean Urls feature.

Hope this post was useful in someways for someone.
Thanking you .. !!!

No comments: