Sunday, December 4, 2011

44. How URL Aliases works in Drupal ?

Drupal has a feature called "URL Alias" that allows you to provide a more understandable name to the content. As far as browsers, servers, and search engines go, it is totally unnecessary. But for humans, it is nearly mandatory. This is why most consultants tell people to always turn on the Path core module, which supports URL aliasing.

You can administer the URL Aliases directly on the node edit or add forms, or by doing the following:

First, visit the page you created. In your browser's address field, you'll see its URL. On the end it will probably say "node/xxx" where xxx is some number. Write down that number. Now go to Administer > Site building > URL Aliases. There's an "Add Alias" tab at the top. In the top box, enter "node/xxx" from above. In the second box, enter "Newurl".

Automatic Alias Generation

If your site is going to have lots of content, particularly user-submitted content, you might want to look at the PathAuto module. Not only will this module automatically generate URL aliases for new content (according to rules you can set up), but can even go back and change aliases in bulk.

Permissions

After you enable the Path module, you need to give the appropriate roles permission to use it in admin/user/permissions. Scroll down to the Path module to enable "administer url aliases" and/or "create url aliases" permissions.

No comments:

Post a Comment