Knowledgebase: Drupal Web Content Management
What is a Drupal URL alias and how do I create one
Posted by on 17 January 2013 04:52 PM
When you create a page using Drupal, the Drupal system refers to it as a node. By default, Drupal assigns it an address such as http://www.dcu.ie/node/30111. In order to make pages easier to find, Drupal allows you to create a more readable address for each node such as http://www.dcu.ie/iss/index.shtml. This is called a URL alias.
It is a requirement that all pages created in Drupal have a URL alias created before they are published to the DCU website.
Where to enter the URL alias
When creating new content, you'll find the URL alias field under the URL path settings section at the bottom of the Add Content page overlay, near the Save and Preview buttons, as shown below:
Format of the URL alias
The URL alias should be consistent with the format used on other pages on the DCU website. You can see an example below:
N.B. This part of the URL (http://www.dcu.ie/) is automatically generated by Drupal. You do not need to type this part of the URL so in the example above the text you would fill in the URL alias box would be:
This part of the URL alias is the folder structure, as set up by the ISS Web Team when initially creating your department's website. What you type in here should be consistent with other pages on your department's website. It is usually also the same as what you select from the Department drop-down when creating a page.
Some exceptions include where your department site is within another section of the website or a parent department's site, e.g. the URL alias for the sites of various departments within Student Support & Development start with students/careers/, students/access/, students/counselling/ etc.
You may also wish to add another level to the folder structure to better organise your site into sections, e.g. using hr/forms/ so that your URL becomes http://www.dcu.ie/hr/forms/form-1.shtml or students/careers/newsletters/ for an URL that reads http://www.dcu.ie/students/careers/newsletters/january-2012.shtml.
This section should generally reflect the title of your page. It should:
The URL alias should always end in .shtml
Format of the URL alias when creating a News Article
The format of the URL alias you should create is mostly the same when creating a news article, with some slight differences as follows:
This part of the URL alias follows the same format that it would do for a normal basic page (see instructions and graphic above), with some slight differences. After the part of the URL set up by ISS for your department, e.g. iss/, students/access/ or dcubs/, you should news/, e.g iss/news/news-article-jan-2013.shtml.
When creating section 3 of your URL alias for news articles, it can be useful to add part of the date to the URL alias - e.g. iss/news/news-article-jan-2013.shtml as this can help keep URL aliases unique and descriptive.
Additional suggestions for sites with frequently updated news sections
If you post news articles to your site very frequently or may have articles with similar titles, it can be useful to year and month layers to the URL alias - e.g. iss/news/2013/jan/news-article.shtml. This isn't strictly necessary and doesn't affect how articles are stored in Drupal, but it can be helpful to allow users to see at a glance when the article was posted.
If using this method, Section 2 of the URL alias should always be in the format department/news/yyyy/mon/, where "department" is your department name as normally used in your URL, "yyyy" is the year in 4-digit format, and "mon" is the month in lower-case, three letter format
Three letter month names
It is important that you are consistent with which option you pick. Either use the regular option, i.e. department/news/news-article-title-jan-2013.shtml or the extra date layers option, i.e. iss/news/2013/jan/news-article-title.shtml, but don't use a mixture of both.