xfpoint

What is Route – Customize Route Filters For Better XenForo Forum Urls

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

  1. SEO Friendly – http://localhost/community/forums/myforum.1/
  2. Non-SEO Friendly – http://localhost/community/index.php?forums/myforum.1/

Threads Route:

  1. SEO Friendly – http://localhost/community/threads/test-thread.1/
  2. Non-SEO Friendly – http://localhost/community/index.php?threads/test-thread.1/

Members Route:

  1. SEO Friendly – http://localhost/community/members/admin.1/
  2. 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:

Or for “t” for “threads”

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

If we have

And want to change the urls to parent child for forums. Customize the route filter as

The same can be implemented for pages as well.

Exit mobile version