Last updated October 29, 2015. Created on September 11, 2004.
Edited by ashish_nirmohi, kdmarks, batigolix, Delphine Lepers. Log in to edit this page.

The core Path module lets you optionally create URL aliases for your Drupal pages. By default, Drupal automatically creates web addresses like, which are not user- or search engine-friendly. Search engines will give better rankings to pages that have more human-friendly URLs, especially if they include relevant keywords - for instance,


As an administrator you can :

  1. Set the path for an individual node with the Path module (on the node/add or node edit form).
  2. Add an URL alias at:
    1. Administer > Configuration > Search and metadata > URL aliases > Add alias in Drupal 8
    2. Administer > Configuration > Search and metadata > URL aliases in Drupal 7
    3. Administer > Site building > URL aliases > add alias in Drupal 6
  3. Administer the list of URL aliases at:
    1. Administer > Configuration > Search and metadata > URL aliases in Drupal 8
    2. Administer > Configuration > Search and metadata in Drupal 7
    3. Administer > Site building > URL aliases in Drupal 6

When combined with using Drupal's "Clean URLs" feature becomes, which is the ideal readable form.

Some examples of URL aliases:

  • image/tid/16 => store
  • taxonomy/term/7+19+20+21 => store/products/whirlygigs
  • node/3 => contact
  • node/10 => products/merchandise/cups
  • node/11 => coffeemakers

You can create URLs as many levels deep in your virtual directory structure as you like. So, for example, suppose a page is called You could give it an alias of

Tips about URL aliases

Avoid changing aliases

Although it is possible to assign the same internal URL to multiple aliases, this is generally not a good idea for search engine rankings; Google, for example, penalizes your site by dropping its rank if Google thinks that you are publishing duplicate content under multiple URLs (a form of web spamming). So if you change your mind later on and must change a URL alias, say from to, you don't want to just delete the old URL, or that page will have to start from scratch building up page rankings.

Redirect old aliases

In the case of a permanent change, use a "301 redirect" from the old URL to the new one. As with many things Drupal, there are several ways to do this, and the best solution will depend on the pattern and number of changes and your environment. Perhaps the simplest solution is to use the Path Redirect (Drupal 6) or Redirect (Drupal 7) modules to create the redirects automatically.

Use aliases from the start

Considering the above, it's best to enable the Path module and assign aliases to your content from the very start. Although batch URL aliasing is possible through several different mechanisms, you don't want to have to deal with the consequences of search engines and external sites already linking to your pages via the /node/xx URLs. Or, if you are converting a site over from another platform (blogging tool, standard HTML-CSS), create your aliases to match the URLs from the previous site. You'll carry all the search engine history right along to the new one.

How to use Path

Enable the path module on the modules page at Administer > Modules (Administer > Site building > Modules in Drupal 6). When users with the right permissions create or edit posts, they'll see a field for "URL path settings." That's where they can enter an alias of their choice.

On the URL aliases page, at Administer > Configuration > Search and metadata > URL aliases in Drupal 7 (Administer > Site building > URL aliases in Drupal 6), you'll see a list of all the URL aliases on your site. There you can edit them, and add new ones. You can assign more than one alias to a page (just use the add alias tab again for each new alias).

On the permissions page at Administer > People > Permissions (tab) in Drupal 7 (Administer > User management > Permissions in Drupal 6), you can decide who can create aliases and who can administer the list of them.

You should consider configuring clean URLs if supported by your server. To automate the generation of URL aliases, look into using Pathauto module.

Programmatically retrieve path

You can retreive the path in your programming code using the function drupal_get_path_alias(), for example as follows.

$path = drupal_get_path_alias('node/1')

Looking for support? Visit the forums, or join #drupal-support in IRC.


ClearXS’s picture

I succeeded to change links from:

"How to Get Only Major Words in the Articles Title?"


Steps in "url-aliases" (admin section of autopath);

* add a lot of non-important short words in the general configuaration to filter in the title, include all single letters, but don't include numbers;

* be sure to have changed the file name to i18n-ascii.txt in the i18n module; failing this lets disappear letters like é, ñ, ö, ... etcetera, causing breaking of words in titles;

* use the form [nid]/[title-raw] what means: title.

Then with a change in .htaccess (within the rewrite rules section) the article title can regenerate itself with only the article-number:

RewriteRule ^([0-9]+)$ node/$1/
(the last "/" is not an error, it works faster and with less errors at my install)

Now if someone doesn't have the proper title-link anymore (broken or whatever), just skinning it down to: ,or
=> will change it for the ..../node/27 original title, what is then changed inmediately for the external and complete official title.

Then it must be possible to intercept broken links, having the broken link automatically skinned down to only the page number = nid(nodeID) page-number. Preferably this only should be done on broken links and not as a general rule for all links. The latter is more easy, because that would be some other general RewriteRule in .htaccess just before the mentioned rule.

But I have no idea what further code should be used and where??!

(all my work here was just checking info and experimenting over 10 hours untill I got it working without knowing these codes)

duykenny’s picture

I'm writing a custom search module.

I can get the parameters from the url easily by using the function: arg()
.arg(0) -> 'node'
.arg(1) -> '3'
.arg(2) -> key+word (So i can work with this later)

But when i added an alias like below --> (the is my search page)

Then I can't get the keyword when reading
.arg(0) -> 'node'
.arg(1) -> '3'
but .arg(2) -> null

Do you have any ideas for this problem.
Thank you so much.

kpv’s picture

cj-cj’s picture

I am getting a problem with paths, I have the path and clean URLs modules installed when you first go to the site you get you can click on an other navigation and get a shortened name ie: or but after the second you have clicked on the second page it goes back to the long URL showing all the folders from where it is hosted to the final page. I can not seem to change this anyone have any ideas?