URL's in TYPO3

What is a URL, and what does it consist of?

A URL stands for Uniform Resource Locator, which is commonly referred to as a link or web address in everyday language. The URL describes the address of a page on the internet, and you can find it in the address bar at the top of your browser window.

The URL primarily consists of a domain (marked in green) followed by one or more path segments (marked in purple). Subpages on the website you are visiting are separated by a slash in the URL. In the example above, there are 2 subpages: Administration and IT.

The path helps indicate where you are on a website. Therefore, the path is usually named after the page being visited. However, the name can be changed, for example, to an abbreviation, which affects the URL's appearance and the visitor's overview.

What can you find in this guide?

There are important considerations to keep in mind when working with and modifying URLs for a page.

This guide provides an overview of the functions of URLs and how they are used in TYPO3 at Aarhus University.

Page setup: Find the page's URL

When you need to find the URL for your page, go to the page settings.

  • You can access the page settings by clicking on the icon in the backend, which is highlighted in yellow in the image below.

  • Afterward, you will find the URL segment under the General tab, where the URL for your page is displayed.

Next to the URL segment, you will find two buttons with different methods for changing the URL's format and length.

  1. The button on the right: Automatically generate the URL based on the page title and its location in the page tree. This method is the most commonly used, as TYPO3 automatically creates a URL based on the page’s location in the page tree and the page title. This makes the URL easy to navigate to.
  2. The button on the left: Manually entered URL. This method is used if you want a shorter URL for a page. By using the manual method, you can decide what appears after the domain. However, be cautious! This method makes it much harder for visitors to navigate Aarhus University's website if the URL does not reflect something accurate.

Note:

TYPO3 automatically creates a redirect from the original URL to the new one if you rename or update the URL using the methods above. 

Create short URLs

Short URLs (shortcuts) are useful and can be used on posters, PowerPoints, or printed business cards. This is a short URL: au.dk/studiestart. The short URL redirects you to the page: studerende.au.dk/studiestart.

There are two ways to create short URLs. They have different advantages and disadvantages, which are described in the guide:

Slugs (page path): How to update and change a URL?

What is a slug? 

A 'slug' is the human-readable part of a URL, which comes after the domain and helps identify a specific page on a website.

For example, the part after the domain in the URL for this page on typo3.au.dk would be the slug – that is "/en/guides/page-setup/urls-in-typo3".

What generates a slug? 

When you change a URL in the backend, a blue pop-up window appears in the upper right corner, which looks like this:

This pop-up window notifies you that redirects have been automatically created for the page and its subpages so that visitors do not end up on a 404 page.

The two buttons – 'Revert update' and 'Revert redirects only' – can help remove old URLs in two different ways:

  • Revert updateUndoes the entire slug update and removes redirects. This means that all the changes you just made will revert to the original, except for anything manually entered in the URL segment.
  • Revert redirects only:Removes only the redirects. When you choose this option, only the most recent slug change will be affected. Thus, all slugs created before this will still exist, including on subpages. In this case, you will receive a 404 error if you use a URL that is neither the most recent nor the original URL.

URLs on translated pages

When you translate a page, a new URL address is automatically created. This new URL will contain "/translate-to-", which is not very user-friendly. Therefore, you should recalculate the link once the page has been named before you save the page for the first time.

  1. Remove [Translate to English:] from your page title and rename it according to the translated language.
  2. Update the URL segment.
  3. Click Save and save the page.

This way, you avoid creating unnecessary redirects with the "/translate-to" page path when you translate your page. 

The guide is based on pages with Danish as the default language, being translated into English. However, the procedure is exactly the same if it's a page with English as the default language being translated into Danish, German, or Spanish.

Issues with cross-language links

In rare cases, you may encounter problems with linking across languages on your page. This may be due to links between languages being broken, causing the page to either display in the wrong language or not display at all.