• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Change "forums" route to "view"

Jake Bunce

Well-known member
As the title says...

For example, this URL:

http://yoursite.com/community/forums/name-here.1/

Is changed to this:

http://yoursite.com/community/view/name-here.1/

This is a popular request from people who install their forum into a directory named forums/ because you get a doubling in the URL like this (directory + route):

http://yoursite.com/forums/forums/name-here.1/

It is strictly a matter of URL beautification. The double "forums/forums" is functionally OK but some people don't like the way it looks and would prefer to change it which is what this addon does.

_____

Note - this addon creates a new route called "view" which simply points to the handler for the default "forums" route. But all templates and other code employing link syntax can and should continue to use the "forums" route internally. This addon intercepts all "forums" links and changes them to "view" so you don't have to change any links in the templates and files. This also means you can disable or uninstall this addon and all links will revert back to "forums".

Redirects are automatically handled as well. If you install this addon and then try to access a "forums" link it will redirect you to "view". But the redirect doesn't work going backwards if you uninstall this addon. If you wish to preserve "view" links in the event of uninstalling this addon then you can enable debug mode and recreate the "view" route:

Admin CP -> Development -> Route Prefixes -> Create New Route Prefix

Screen shot 2011-11-10 at 6.20.32 PM.webp

I tested this in both 1.0.x and 1.1.x
 

Attachments

Thanks again Jake, I ended up renaming a few things to also change "threads" to "viewing" which I wouldn't have been able to do from scratch.
 
+Like
Cool tweak.

This is a popular request from people who install their forum into a directory named forums/ because you get a doubling in the URL like this (directory + route):

This ongoing issue could be solved by giving future xenforo users "Tips" in the installation instructions about this problem. :(
 
I honestly should've changed my forum folder name to boards instead of the name forums. How bad would google penalize me if I changed it to boards and uninstalled this modification?
 
Jake,

Do you see any repercussions if I were to change threads to use the view prefix?

Thanks,
Itworx4me
 
I honestly should've changed my forum folder name to boards instead of the name forums. How bad would google penalize me if I changed it to boards and uninstalled this modification?

There is no penalty if you redirect the old traffic to the new location.

Do you see any repercussions if I were to change threads to use the view prefix?

That's fine. You can modify this addon to extend the thread route instead of the forum route.
 
Jake is it possible to have view as the forums and threads prefix? I tired but it over wrote the view forums to view threads. Says you can only have one unique prefix. Can there be Two or maybe Three?
 
Top Bottom