Our new forum platform is pretty smart about permalinks. Edited topic titles and typos won’t interfere with forwarding. Shortening URLs is easy, and pointing users to a specific post (or place in time) in a topic is very straightforward. Here are some uses for permalinks:
- Bookmark or link to a category or tag topic list
- Bookmark or link to a topic list filtered using both a category and a tag
- Point to a specific moment in time in a topic
- Point to a specific post in a topic
- Save an advanced search using a variety of search terms
Contents
- Permalink Syntax
- Adaptive URLs
- Pointing to a specific post or time
- Shortening URLs
- Legacy URLs from Vanilla
Permalink Syntax
Discourse provides permalinks for categories, tags, topics, and posts. Permalinks for categories and tags are slightly different from topics and posts.Category & Tag Permalinks
This is a typical permalink for a category:
/c/plex-media-server/computers
This is a typical permalink for a tag:
/tags/windows-server
Discourse category and tag permalinks contain these 4 parts:
| Type | Top Level Category or Tag | 2nd Level Category |
|---|---|---|
c or tags
|
plex-media-server | computers |
Type : ”c” denotes that it is for a category, and “tags” is for tags.
Top Level Category or Tag : This can either be the top level category or just the tag.
2nd Level Category : Optional, used only when filtering down to a 2nd level category, and not used when filtering by a tag
Topic & Post Permalinks
This is a typical permalink for a topic:
/t/watch-crossover-episodes-of-several-series-in-order/217412/1
Discourse topic and post permalinks contain these 4 parts:
| Type | Topic Title | Topic ID | Post # |
|---|---|---|---|
t |
watch-crossover-episodes-of-several-series-in-order | 217412 | 1 |
Type : ”t” denotes that it is for a topic. This is required for the permalink to resolve properly.
Topic Title : The title of the topic, as provided by the user. It’s there for SEO purposes and is not actually needed to get the visitor to the correct topic. Further down we refer to this also as the “friendly” name.
Topic ID : The topic’s serial number, and, consequently, the most important part of the permalink. This is needed to get the visitor to the correct topic.
Post # : Optional, denotes the post ID, takes the user to the specific post in the topic.
Adaptive URLs
The most common type of permalink shared by users and staff is the one for topics and posts. Here is an example”
/t/watch-crossover-episodes-of-several-series-in-order/217412/1
Let’s break this permalink down:
| Type | Topic Title | Topic ID | Post # |
|---|---|---|---|
t |
watch-crossover-episodes-of-several-series-in-order | 217412 | 1 |
This permalink contains a SEO ”friendly” topic title. If the user were to edit their topic title and change it to something else, existing permalinks posted in the forums or shared outside of the forums will still forward, as expected. Example:
A user creates the topic “Watch Crossover Episodes of Several Series in Order”. which results in this permalink:
/t/watch-crossover-episodes-of-several-series-in-order/217412
The user later decided to change the topic title to ”Watch Crossover Episodes in Order”, resulting in the permalink updating to:
/t/watch-crossover-episodes-in-order/217412
As long as the Topic ID (in this case: 217412) is present, it doesn’t matter if someone uses the old permalink or the new one, the destination will be the same. When using old/outdated permalinks, Discourse will forward to the new one so users can see the different in their browser.
Pointing to a specific post or time
You can forward users to the first, last, or any post in-between in a topic.
First Post
Add /1 to the end of a topic permalink to point to the first post in the topic. Example:
/t/watch-crossover-episodes-of-several-series-in-order/217412/1
Last Post
Add /last to the end of a topic permalink to point to the first post in the topic. Example:
/t/watch-crossover-episodes-of-several-series-in-order/217412/last
Specific Post
Discourse uses Post ID to forward users to a specific post in a topic. You can enter the post number manually, or copy/paste it by clicking the Share button or right-clicking on the date for the post.
IMG : permalinks 1
The resulting permalink to a specific post will look like this:
/t/watch-crossover-episodes-of-several-series-in-order/217412/2
This also works with the shortened version:
/t/217412/2
Shortening URLs
If size matters when sharing permalinks in the forums, Slack, or elsewhere, you can remove the Topic Title and keep the permalink in tact. Example:
| From | To |
|---|---|
/t/watch-crossover-episodes-of-several-series-in-order/217412 |
/t/217412 |
This also works when pointing to a specific post in a topic. Example:
| From | To |
|---|---|
/t/watch-crossover-episodes-of-several-series-in-order/217412/03/ |
/t/217412/03 |
Legacy URLs from Vanilla
Top & Latest
Vanilla uses #Top and #Latest at the end of their URLs to point users to the top or bottom of the thread. Discourse does not use this method, and thus anything after the # in legacy URLs from Vanilla were ignored in our migration to Discourse. With that stripped from the permalink, Discourse will by default send users to the top (first post) of a topic.
Specific post in a topic
Discourse is forwarding all legacy URLs from Vanilla that contain a reference to a specific post in the topic (such as #Comment_907265) to the same place in the Discourse topic.
Permalinks in Vanilla that send users to a specific post in a topic look like:
/discussion/comment/907265/#Comment_907265
In Discourse, the same permalink forwards to:
/t/kurzanleitung-filebot/100059/8