Study guide · Access, links and redirects
Who sees what, and where links lead
Not every page is meant for everyone, and not every address stays the same forever. On this page you learn how to schedule content and how to show it only to visitors who have logged in. After that, it is all about links: readable addresses, QR codes, short URLs and redirects. By the end, you know which status code fits which case and how to avoid redirect chains and loops.
The example: Weidenau City Library
All examples take place on the website of Weidenau City Library. It has the pages Home, Events, Media, Opening hours and Contact, plus an English language version. Lena is an editor and looks after the content. Tom is the administrator and sets up the installation.
Three tasks are coming up. The library's reading club gets an area for members only. Flyers with a QR code are being printed for next year's reading night. And after the move from the old website, old addresses should keep working.
Visibility and scheduling
A hidden element does not appear in the frontend, whether it is a page, a content element or a news item. In the backend, however, you can still see it and check it in the preview. You find all visibility settings on the Access tab of the page properties or of the content element.
This is also where you set a time window:
- With a Publish Date, an element only becomes visible from that moment on.
- With an Expiration Date, it is hidden from that moment on. It is not deleted. It stays in the backend, and you can make it visible again at any time.
Lena uses this to announce the summer reading campaign. The notice appears on the first day of the holidays and disappears after the last one. She does not have to worry about the cache. TYPO3 calculates the lifetime of the page cache so that it expires exactly at the next change in visibility. The page is then rebuilt, without anyone saving it or clearing the cache by hand.
What happens if someone opens a page whose Publish Date lies in the future? According to the Editors Guide, you end up on the home page. TYPO3 14 itself answers with "page not found", that is status 404. What the visitor finally sees depends on the error handling that the administrator has set up for the site.
Website users and their groups
TYPO3 knows two kinds of accounts. Backend users such as Lena and Tom maintain the website. Website users, also called frontend users, are visitors who log in on the website itself. You use them to build members' areas. Backend groups and website groups have nothing to do with each other.
Website users always belong to website user groups. TYPO3 grants access only to groups, never to individual users. If someone should get into a protected area, you add them to the group that has access. You do not enter them on the page, and they do not need a backend account either.
Users and groups are ordinary records. They do not live in the backend users module, but in a folder in the page tree. This is how Lena sets up the reading club:
- Lena creates a folder called "Website users" in the page tree.
- She opens the Records module under Content and selects the folder.
- Using "Create new record", she creates a "Website Usergroup" named "Reading club".
- Then she creates a "Website User" with a username, a password and the group "Reading club".
- She can add further details such as name or email on the "Personal Data" tab.
Protecting pages and content
You set up access on the Access tab, in the field Frontend User Group Access Rights. There you select one or more groups. Besides your own groups, the list always contains two special groups. You can neither edit nor delete them:
- Hide at login shows an element only as long as nobody is logged in. As soon as someone logs in, it disappears.
- Show at any login requires a login, but allows all groups. Every logged-in website user sees the element.
For the reading club, Lena builds a public page called "Reading club" with two text elements. The first says "Please log in to see the reading list" and gets the group "Hide at login". The second contains the reading list and gets the group "Reading club". The page itself stays public, otherwise guests could not see the notice at all.
If you restrict a whole page to a group, its icon in the page tree changes. It reminds you that the page is not public. Anyone who opens such a page without permission does not see its content, but an error message. The Editors Guide calls it "Page Not Found". Technically, TYPO3 14 answers with status 403 for "access denied", and the site can show its own error page for this.
The library also has an "Internal" area with thirty subpages for the group "Team" only. Lena does not restrict every page one by one. She sets the group only on the "Internal" page and switches on "Extend to Subpages". This saves work, and no subpage gets forgotten.
The login form
For members to log in, the website needs a login. Lena adds a new content element on the "Reading club" page. In the wizard, the element Login Form sits on the "Form elements" tab. On the "Plugin" tab there are many options, but only one is really required: the User Storage Page. That is the folder where the website users are stored. Often the integrator has already set a default for it, and then you do not have to enter anything.
The login can send members to another page after they log in, for example to the reading list. There is one trap. If the login plugin is set to "Hide at login", it is hidden after the login and can no longer carry out the redirect. That is why neither the plugin nor the target page may be set to "Hide at login".
TYPO3 protects the login against people guessing passwords. By default, website users may get it wrong ten times in fifteen minutes. For backend users the limit is five attempts. Administrators can change both values.
Readable addresses and good links
Every page has an address, a URL. The contact page with a parameter and a jump target shows its parts:
The part after the domain, such as /contact, is called the path. A readable URL, sometimes called a speaking URL, describes the content in words, for example /about-us instead of an address with the parameter id equals 42. People and search engines understand it better. TYPO3 builds it from the slug, the URL segment in the page properties.
You set links in the rich text editor or in link fields using the Link Browser. It offers several link types:
- A page of your own website, optionally with an anchor to a particular content element.
- A file or a folder from the file management.
- An external URL of another website.
- An email address or a telephone number.
Links need care. If you rename, move or delete pages, you otherwise end up with dead links. They frustrate visitors and hurt your ranking in search engines. So check references and set up a redirect when needed.
The Link Management module
In TYPO3 14 you manage redirects, QR codes and short URLs in one place: the Link Management module under Sites. It has three submodules: Redirects, QR Codes and Short URLs. If you cannot see the module, either you lack the permission for it, or the system extension redirects is not installed. In that case, ask your administrator, which at the library means Tom.
Technically, all three are redirect records, and their forms are built in a similar way:
- The "General" tab holds the source and the Target. The target can be a page, a file or an external URL. With Force SSL Redirect you force https for the target.
- The "Access" tab holds Enabled as well as Publish Date and Expiration Date, in other words a start and a stop time. This lets you switch an entry on and off or limit it in time, for example for a campaign.
- On the "Notes" tab you leave an internal note for other backend users.
Creating redirects
A redirect automatically takes visitors and search engines from an old address to a new one. Without it, old links and bookmarks lead nowhere, and visitors land on an error page with status 404.
The library's old website had the address /contact.aspx. Lena opens the Redirects submodule under Link Management and clicks "Add redirect" or the plus icon. Then she fills in the form:
- Source Domain: Here she picks a domain from the site configuration. The asterisk is a wildcard for all sites of the installation and is preselected in the form.
- Source Path: Here she enters the old path, that is
/contact.aspx. TYPO3 ignores query parameters in the requested address when comparing, as long as Respect GET Parameters is off. - Target: Here she selects the new "Contact" page in the page tree.
- Status Code HTTP Header: 307 is preselected. More on this in the section on status codes.
- Keep GET Parameters: If this option is on, TYPO3 adds the parameters of the old address to the target. By default they are dropped.
So when comparing with the source, TYPO3 uses the domain and the path, and the query parameters only if you want it to. It cannot compare the fragment at all, because the browser does not send it.
Everything from the old blog under /blog/ should move to /news/. Lena does not create a hundred separate rules for this. She switches on Is regular expression? and writes a pattern into the Source Path. In the target, she refers to the matching part with a placeholder such as dollar 1. TYPO3 does not check the syntax of such patterns. You have to avoid mistakes yourself, ideally by testing first.
Source Path: #^/blog/(.+)#
Target: /news/$1Further fields help with managing. Protected does not affect the redirect itself. It protects the record from being deleted automatically by a cleanup command. Creation Type shows whether a redirect was created automatically when a slug changed or by hand in the module. You can also filter the list by this field, as well as by path, status code or creator. Editors without admin rights only see redirects of their own sites and those with the asterisk.
Tom wants to know which old rules nobody uses any more. For that he needs the hit counter. It is off by default and is switched on with a feature toggle. Only then does the module show the hit count and the last hit, and the filter "Never hit" becomes available.
Automatically when the slug changes
Lena renames the page "Opening hours" to "Plan your visit" and changes the slug from /opening-hours to /plan-your-visit. The redirects extension is installed, and automatic creation is active in the site configuration. So TYPO3 now creates a redirect from the old to the new address by itself. This also applies to all subpages whose slugs change along with it.
TYPO3 then shows a notification with two options. Lena can undo the whole slug change including the redirects, or remove only the redirects. In a workspace, no automatic redirects are created. Automatically created redirects get the status code 307 by default.
Status codes, chains and loops
With every redirect, the server sends a status code. It tells the browser or the search engine whether the move is permanent or temporary:
- 301 means "Moved Permanently" and 308 means "Permanent Redirect". Both are permanent.
- 302 means "Found" and 307 means "Temporary Redirect". Both are temporary.
- Do not confuse them with other codes: 200 means success, 404 "not found", 410 "Gone", that is removed for good, 403 "Forbidden" and 500 a server error.
TYPO3 uses 307 by default, both for automatic redirects and in the form. With permanent redirects, search engines pass the ranking of the old URL on to the target. So if a page moves for good and should keep its ranking, you set 301 by hand. This makes sense after a relaunch, for example.
A 301 has a downside, though. Browsers and search engines remember it for a long time. If you ever want to use the old address differently, do not use a 301. For reading night 2027, Lena therefore creates the address /reading-night-2027 with status 307 and points it at the home page for now. As soon as the reading night has its own page, she only changes the target.
A redirect chain is several redirects in a row, for example from a to b and from b to c. It works, but it is inefficient. If you find a rule from /a to /b and one from /b to /c in the module, point /a straight to /c. An extra rule back to /a, on the other hand, would be fatal.
That would create a redirect loop: the redirects lead round in a circle, for example from a to b and back to a. The page can no longer be loaded. The documentation usually names an error 500 for this, while many browsers simply report too many redirects. A rule that points straight back to its own address is detected by TYPO3 itself, and TYPO3 does not carry it out. Faulty redirects therefore do double damage. Visitors end up on error pages or in loops, and search engines rate the pages lower.
QR codes and short URLs
For reading night, the library prints flyers with a QR code. But the target page is not decided yet. That is not a problem: every QR code from Link Management contains its own permanent address on your domain. You can change the target behind it at any time, and the printed code stays valid.
- Lena opens the QR Codes submodule under Link Management and clicks "Add QR Code".
- She selects the library's Source Domain.
- As the Target she picks the home page for now. A file or an external URL would also be possible.
- On the "Access" tab she sets the Publish Date to the start and the Expiration Date to the end of the promotion.
- After saving, she downloads the code with "Show QR Code", as PNG or SVG in 64, 128, 256 or 512 pixels.
In the list, Lena can edit a code, delete it, or switch it off with "Hide" without deleting it. Anyone who scans a code that is switched off gets a 404 page.
A short URL is a short path on your domain that redirects to a target, for example /summer-reading. It suits print, newsletters and social media. The target can be a page, a file or an external URL. Short URLs exist since TYPO3 14.2.
In the Short URLs submodule, Lena clicks "Add Short URL", selects the domain and enters the path. Alternatively, the dice icon "Generate Short URL" next to the path creates a random path with eight characters. A short URL must be unique for its domain. If a colleague creates the same short URL on the same domain again, the form marks the domain and the path, and TYPO3 refuses to save it.
Key points
- Publish Date and Expiration Date control visibility, and the page cache expires by itself when visibility changes.
- Extend to Subpages passes times and group restrictions on to the whole branch.
- Website users and their groups are records in a folder. Only groups get access rights.
- Hide at login shows elements only to guests, Show at any login to everyone who is logged in.
- The Login Form needs the User Storage Page. For a redirect after login, neither the plugin nor the target page may be set to Hide at login.
- Link Management under Sites brings together Redirects, QR Codes and Short URLs.
- TYPO3 uses 307. For permanent moves that keep their ranking you use 301, for addresses with a future you use 307.
- Shorten chains, and avoid loops.
Terms
- Website user
- A visitor with an account who logs in on the frontend, also called a frontend user.
- Hide at login
- A special group that shows an element only while nobody is logged in.
- Show at any login
- A special group that shows an element to all logged-in website users.
- Extend to Subpages
- An option on the Access tab that passes times and groups on to all subpages.
- User Storage Page
- The folder in which the Login Form looks for website users.
- Slug
- The part of the URL that a page defines in its page properties.
- Redirect
- Forwarding from an old to a new address with a status code.
- Short URL
- A short, fixed path on your own domain with a target you can change.
- Redirect chain
- Several redirects in a row.
- Redirect loop
- Redirects that lead back in a circle, so the page never loads.