1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Remove "/pages" from pages URL?

Discussion in 'XenForo Development Discussions' started by Kevin, Nov 20, 2011.

  1. Kevin

    Kevin Well-Known Member

    I'm working on something for an XF site where a series of static HTML pages will work out perfectly. However, I would really like not having the /pages identifier in the URL shown.

    Organization wise I will be ending up with a page named (for example) Widgets. The Widgets page will be an overview with links to additional pages that are the details for each type of Widget. For example, Sprockets might be a type of widget.

    What I would really love to end up with is the following URL structure for the XF pages.

    {site.com}/forums
    {site.com}/widgets
    {side.com}/widgets/sprockets

    Doable somehow? :coffee:
     
    Brandon Sheley likes this.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You can't remove the "pages" prefix entirely but you can change it with an addon, like this:

    http://xenforo.com/community/threads/change-forums-route-to-view.22998/

    I didn't make one for pages, but the code is very similar. You would need to extend the pages route instead of the forums route. Then define the new route in your Admin CP (as shown in the screenshot).
     
    Kevin and M@rc like this.
  3. Kevin

    Kevin Well-Known Member

    Jake, thanks. Though that can't remove it (thinking out loud, I wonder if .htaccess could be tricked somehow to do it) that is a pretty useful mod that I might be able to make use of for some other ideas floating around my head. (y)
     
  4. Infuscu

    Infuscu Member

    Kevin, just wondering if you found a solution? :)
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  6. Infuscu

    Infuscu Member

    Jake, I am not entirely sure what situations you'd use your addon - can you specify?

    I've seen website where they've avoided to use the pages url. I've asked and got a reply stating that they used a custom plugin which totally avoided the buildin page function.
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    This site used the route changer to translate all routes to spanish:

    http://foroxenforo.net/paginas/manual/

    pages = paginas

    Yes that is possible. If you create your own addon then you can create your own route. But if you use a page node then you are bound to the "pages" route.
     

Share This Page