Subscribe

Enter your email address:

Delivered by FeedBurner

Previous Posts

Tuesday, May 23, 2006

How To Configure Clean URL Support

And why you would want it...

As I am finding out, drupal has lots of modules and lots of settings. You could probably spend an entire lifetime understanding them all. One of the challenges of the non-wiki format is that posts and comments on drupal.org from people who are providing help become out of date. So instead of a "master" article being corrected an updated (a la wikipedia), you have to scroll through the entire set of posts to see the most recent. Of course, you see the oldest posts first, then the newest at the very bottom. But when you're looking for help, you really want to see the newest posts at the top and the oldest posts at the bottom (like a blog).

In any case, the reason you would want Clean URLs is that clean URLs are SEO-friendly. The reason you want SEO-friendly URLs is that they are more easily indexed by the search engine spiders, and besides, they look nicer to users. An "dirty" URL is of the form www.mysite.com?q=node/4, whereas a "clean" URL is of the form www.mysite.com/node/4. The different is in the ?q=, which can confuse some spiders and annoy humans.

Why doesn't drupal ship with clean URL support on by default? Because... they expect you to be an admin! The real reason is that some web servers aren't configured to support the rewriting necessary to get from the "dirty" format to the "clean" format, resulting in an installation that doesn't work and no way to fix it. This is sometimes the case on shared hosting servers. Kind of reminds me of installing old revs of Linux before Red Hat and SuSE matured the installation process. They use to configure everything even for the 1% case rather than focusing on the 90% case.

So to configure Clean URL support, check this out. The bottom line is you can just go to Administer | Settings | General Settings then scroll down till you see Clean URL support. Don't see it? I didn't see it the first time either. Try using your web browser's search function. You'll need to run the "clean URL test" (look for the little link) first.

If you look on the drupal web site, you'll find many of the comments are out of date (as I indicated earlier). You'll see that the most recent versions of drupal don't require you to modify the Apache .htaccess configuration files directly - you can simply change the setting via the drupal administration interface.

5 Comments:

Anonymous Anonymous said...

You can event take clean URLs one step further with drupal. As you can see on our Java portal:

http://cricava.com/java/index.php

Link to articles include the article title on the URL, such as:

http://www.cricava.com/java/postgresql_actualizado_para_evitar_sql_injection

Which is what you really want when optimizing URLs for SE. This is of course more SE friendly than node/4.

That funcionality can be achieved by using a Drupal module called path.module, available at:

http://drupal.org/node/14546

May 25, 2006 9:43 AM  
Blogger David said...

Thanks for this great pointer! Definitely a must to install the pathauto module.

May 25, 2006 8:42 PM  
Blogger David said...

Here a link to PathAuto. Make sure you get the right release of the module for the version of drupal that you have installed. If you search drupal.org for pathauto, the page that comes up shows the latest version as 4.6.0. It's not... the latest version is available on the latest version page (why don't they just say that?)!

May 25, 2006 8:44 PM  
Blogger David said...

The latest version of PathAuto. Make sure you get the right version for your installation.

May 25, 2006 8:45 PM  
Anonymous Anonymous said...

Super color scheme, I like it! Keep up the good work. Thanks for sharing this wonderful site with us.
»

July 17, 2006 5:49 PM  

Post a Comment

<< Home