Understanding SEF URLs in Drupal 7

Drupal 7 has a built in system to “clean” URLs so they are search engine friendly. In this tutorial, we’ll explain further what search engine friendly URLS are.

With most websites on the Internet being dynamically generated, the URL usually contains information about the query being used to generate the page on the server. Some search engines will not index pages that have special characters in the URL, which is needed to generate the page.

All of InMotion Hosting’s servers support mod_rewrite which is needed to use “clean” URLs. If you are not hosting with InMotion, you may have to enable Apache mod_rewrite on the server or contact your hosting provider for further information.

Drupal makes solving this quite easy. So let’s take a look at an example:

Before After
https://drupal.inmotiontesting.com/?q=about_us https://drupal.inmotiontesing.com/about_us
drupal_blog_3xx

drupal_blog_3x

If you notice, nothing on the page changed. The only thing that changed is in the URL structure from:
?q=about_us to about_us

There are no longer any characters that could cause an issue with search engines.

In our next few tutorials, we will show you how to enable clean URLs and also how to set your custom aliases (in the above example, about_us is the custom alias).

Was this article helpful? Let us know!