How To Setting up SEO Friendly clean URL in drupal 7 ?

  0 comments
Share

Search engine optimization (SEO) is an important part of managing a website. SEO helps the search engines to figure out what each page is about, and how it may be useful for users. A way to help give your site some SEO juice is by making the URLs to your web pages SEO friendly.

Enable Clean URL

The default strings of URL in Drupal are dynamic and have search engine unfriendliness ?q=

http://example.com/?q=node/1

Clean URL state is controlled by the Drupal variable clean_url.

  • clean url disabled: clean_url is 0
  • clean url enabled: clean_url is 1

To change above URL to clean URLs, Go to /admin/config/search/clean-urls and enable the "Enable clean URLs" checkbox.

Enable clean url Image

You can also change this value by:

  • Using drush

    drush vset clean_url 1

  • Add a value in settings.php

    $conf['clean_url'] = 1;

After switch to clean URL path would be

http://example.com/node/1

Configure pathauto for Advanced URL Path Aliases

Drupal's Pathauto Module is a great module for SEO. It provides a quick and easy way of automatically creating meaningful URL's. without requiring the user to type in a URL path manually for each node (page, story etc), category and users, it will do it automatically based on custom Pathauto settings, like the category it belongs to and the title.

Pathauto provides an interface to enables a ?pattern? which you can set.

For further extend URL paths and aliases functionality.

  • Download and install module token and pathauto.
  • Go to /admin/config/search/path/patterns and set the pattern for all/whatever content type, Taxonomy term and User you want.

    Set url pattern Image

  • Scroll down to the bottom of the page and click Save configuration button for save your pattern.

So it would do the same thing as the basic alias by aliasing for example:

http://example.com/node/1 now change to http://example.com/about-us

you can also override path alias manually

  • Edit the node which alias you want to change manually and click on URL path settings tab.
  • Uncheck the checkbox "Generate automatic URL alias"
  • Change manually the alias next to URL alias

    Manually Set path

Change existing URL paths using pathauto

Take a look on blog Updating existing URL paths using pathauto regarding it.

Add new comment