How to Create SEO-Friendly URLs using Drupal

Drupal is an open-source content management system widely used in web design, only second to WordPress. Initially, after installation of Drupal and creation of the page, the URL created will probably look like this:

http://yourdomain.com/node/258

However, it is possible to reset your Drupal so that it gives you ‘clean’, SEO-friendlier URLs for instance:

http://yourdomain.com/contact-us

 

Performing the initial set-up

Before enabling the actual module, you need to make sure that your server has been set up to handle ‘clean’ URLs. To do this, log in to your server Admin page/dashboard and select ‘Clean URLs. Where possible, enable it.

If the text is disabled (i.e. grayed out), you will need to make the relevant adjustment on your website’s .htaccessfile. You can access the .htaccessfile from your website’s root. You’re looking for the line “ #RewriteEngine on”. Remove the “#”, save and upload the copy onto your server. Go back to Admin>>Clean URLs, and you should be able to enable it now.

If you’re still not able to change the option, confirm that you uploaded the modified .htaccessfile successfully. If yes, you may still require installing mod_rewrite onto your server. Your web hosting company should be able to do this for you, but if you’re the server owner, find the manual for instructions on how to do it.

The Path Module

In order to be able to use SEO-friendly URLs, you need to ensure that the Path Module is enabled. This can be through the following path (no pun intended):

Administer>>Modules>>Path

From there, enable the moduleNow setting. Every time you edit a webpage, you should be able to see the “URL Path settings” option on the page. Within the input box, type in your user/SEO-friendly URL such as ‘home’, ‘about-us’, ‘article-title-separated-by-hyphens’ etc. DO NOT start the URL with a forward slash.

The PathAuto module

Alternatively, you can automate creation of friendly URLs using the PathAuto module. This is especially useful where you will hand over the site over to clients, since they won’t have to use specific URL aliases. The process is both very configurable and automated. The module is easily downloadable from the Internet.

After downloading and enabling the module, go to /admin/build/path/pathauto from where you can configure automated URL aliases for different content types. For instance, if you have content under the types News, Events and Profiles, your configuration for them will be “news/[title-raw]”, “events/[title-raw]” and “profiles/[title-raw]” respectively.