Knowledgebase

How to enable and manage clean URLs and URL aliases in Drupal

After you install Drupal on your HostKnox Drupal hosting account, clean URLs should be enabled by default. This means that, for example, with clean URLs enabled the URL address of page on your site will have the form of yourdomain.com/node/2, instead of yourdomain.com/?q=node/2. To find the option for clean URLs, log in to the admin panel of your Drupal, click on the Configuration tab in the navigation bar, and on the page that opens click on the Clean URLs button (it's under Search and Metadata). On the following page there's a checkbox called Enable clean URLs; it should be marked.

You can also generate URL aliases to make the links to pages on your site more user-friendly. You can do this for items (nodes) from the different content types, for users, taxonomy terms, etc. One way to do this for nodes, for example, is to add the alias when creating/editing the particular node (e.g. article, basic page, etc.). You can do this on the page with the settings for the particular node (admin panel>Content tab>edit button for the node). Scroll down to the bottom of the page, click on the button URL path settings on the left, and type the URL alias in the field that's provided.

To manage all URL aliases and also add new ones, click on the Configuration tab in the navigation bar of the admin panel, on the page that opens click on the URL aliases button that's in the section Search and Metadata. This will open a page containing a table with all the aliases that you have generated (if any). To edit or delete an alias click on the respective button in the table. To add a new alias click on the Add alias button. On the page that opens you have to specify the URL address of the particular page and the desired alias.

There is also a third party module for generating URL aliases automatically. It's called Pathauto. Before you can use it you also have to install and enable the module Token. The Pathauto module also allows you to mass update/generate aliases, to generate aliases according to specific patterns, and also to delete many or all aliases simultaneously.

For more details and screenshots you can also check out our Drupal clean URLs and URL aliases tutorial.

Was this answer helpful?

 Print this Article

Also Read