Web Hosting Line
1.800.828.9231
Drupal Hosting
Drupal Tutorial
Drupal Themes
Drupal Modules
Drupal FAQ
Host Package
Free Domain name
750 GB space
7500 GB Traffic/mo
99.9% Server Uptime
24/7 Top Customer Care
FREE Drupal Installation
Immediate activation
The Best Host Package
learn more sign up now
Display entire tutorial on one page. Print-friendly version.

Search Engine Friendly URLs

Why Use SEF URLs in Drupal?

Here we will try to explain how you can enable the clean URLs in Drupal in three simple steps. We're happy to inform you that all SiteGround servers fully support the Apache mod_rewrite module and all Drupal users hosted on our servers will be able to use the clean URLs option.

There are only 3 steps you need to follow to enable the Search Engine Friendly URLs. Here we assume that you already have Drupal installed on your account into the /drupal subfolder (www.yourdomainname.com/drupal) and you want to activate the clean URLs.

You have a number of reasons to do this:

  • Your site will look more friendly for the search engines and you will receive better chances to climb up in the search engines rank statistics.
  • The Drupal clean URLs increase the security of your website by making harder for the attackers to find sensitive information about the scripts of your web site.

How to Activate Search Engine Friendly URLs in Drupal?

Step 1: The first step is to log in the cPanel area for your account. Then, please, click on the File Manager icon and navigate to the folder where the Drupal CMS is installed in. (In our example this would be: /public_html/drupal).

Once you are inside the Drupal directory edit the .htaccess file.

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]

Please mind that 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 /

Step 2: The next step is to log into the administrative back end of your Drupal site and enable the "path" module. This module is essential for the clean URLs in Drupal. Once you are logged click on the "Administer" link on the left menu and then on the "Modules" link:

Drupal - Administer - Modules

Scroll down the page, find the "path" module and tick the little check box on the right of the module and simply save the settings:

Drupal - path module

Step 3: The next and the final step is to test the clean URLs and confirm the changes. In the administrative back end point your browser to the "Site configuration" link from the left menu and click on the "Clean URLs" link.

You will not be able to confirm and save the clean URLs change until you test them. Drupal is a smart application :) Once you are in the "Clean URLs" menu, scroll down the page and hit on the "Run the clean URL test" link:

Drupal - Run the clean URL test

If everything is ok the page will be reloaded and you will be able to select the "Enable" radio button and save the changes.

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.

Congratulations! You have done a great job!



Drupal Hosting
(c) Copyright 2005 SiteGround Web Hosting Services. All rights reserved