End of Year Promotion - 10% off Zend Training
So we've just created our first piece of content or "Node" as it is referred to in Drupal. We noticed after saving and publishing the node, that it had been labeled with "/node/1" following the domain name. From an organizational point of view, the current URL is irrelevant. Now we are going to discuss how to give a more descriptive URL to our nodes. We will enlist the Path Module.

We'll need to be logged into Drupal with an administrator account to enable new modules. On the navigation menu select Administer.

Drupal Administrator Navigation

The Administer section is divided up into five major task categories; Content management, Site building, Site configuration, User management and reports. Within the Site building task category, we want to select Modules.

Drupal Site Building Modules

The Modules page will display two collapsible menus (Core - optional & Core - required) listing the available modules, version, description and whether or not they are currently enabled. Note: Later when we learn how to download and install more modules we will see this list grow with more collapsible menus.

Go ahead and enable the Path Module in the Core - optional section. All modules will always be in alphabetical order with the collapsible menu. Scroll to the bottom of the page and hit the Save configuration button.

Drupal Enable Path Module

If everything was done properly the informative green text on top will say The configuration options have been saved.

Once the Path Module has been enabled, a new collapsible menu entry will be added to node edit screen called URL path settings. Go ahead and try to edit existing content or create a new page, you'll see the new menu.

Drupal URL Path Settings

Click on the collapsible menu to reveal the URL path entry. In the text box provide a meaningful URL you would like to give to this page. You can enter the fully qualified URL without a trailing slash, such as:

http://mysite.com/article/firstarticle
http://www.shophere.com/products/spring2009/dresses

You can also enter the relative path without leading/trailing slashes:

aboutus
article/firstarticle
products/spring2009/dresses

Once you save the page, the URL will change from http://mysite.com/node/1 to http://mysite.com/article/firstarticle. You will be able to change the URL path at any time by editing the node. Note: It can be advantageous to enter just the relative path as opposed to the fully qualified path as it will save time on entry or headaches, if the domain name is ever changed.

One further item to note, by enabling the Path Module a new menu item was added to Administer, Site building called URL aliases. Drupal still retains the chronological number of each node created; path creates an alias for that node number. In URL aliases you can view, edit or delete aliases for all nodes.

Drupal URL Aliases