What is Route?
The route in XenForo is the term used for XenForo to understand which controller to load and determines the page renderer. It is independent of the SEO friendliness of the URLs.
Here are some examples of route assuming the XenForo is installed at http://localhost/community/
Forums Route
- SEO Friendly – http://localhost/community/forums/myforum.1/
- Non-SEO Friendly – http://localhost/community/index.php?forums/myforum.1/
Threads Route:
- SEO Friendly – http://localhost/community/threads/test-thread.1/
- Non-SEO Friendly – http://localhost/community/index.php?threads/test-thread.1/
Members Route:
- SEO Friendly – http://localhost/community/members/admin.1/
- Non-SEO Friendly – http://localhost/community/index.php?members/admin.1/
Each URL can accept further parameters to identify multiple pages of a thread or forum and can accept query parameters like standard URLs.
So the route is the first part of the URL and is independent of SEO friendliness of the URL or the secondary portion of the URL.
Route Filters
XenForo has the default route for each functionality but one can always customize the route using the route filters.
If you wish to use “f” for “forums”, in the route filter use:
- Find Route: forums/
- Replace With: f/
Or for “t” for “threads”
- Find Route: threads/
- Replace With: t/
Each node (aka forum/sub-forum or page) can be customized with url portion to avoid the id in the url. With route filters, one can completely avoid the forums part in the URL or create a parent-child based url structure for forums.
If you wish to completely remove the “forums” from the url, create a route filter for each forum as
- Find: forums/myforum/, replace: myforum/
- Find: forums/myforum-1/, replace: myforum-1/
If we have
- Category (forums/category/)
- forum (forums/myforum/)
- subforum (forums/mysubforum)
- forum (forums/myforum/)
And want to change the urls to parent child for forums. Customize the route filter as
- Find: forums/category/, replace: category/
- Find: forums/myforum/, replace: category/myforum/
- Find: forums/mysubforum/, replace: category/myforum/mysubforum/
The same can be implemented for pages as well.