Skip to:
Content
Pages
Categories
Search
Top
Bottom

Any way to eliminate redundancy/weirdness in permalinks (i.e. “forums/forum”)?

  • I’m in the process of converting a standlone BBpress 1.1 installation into the 2.02 plugin version (well, really, recreating it from scratch in the plugin version, because the importer apparently doesn’t work if your blog actually has any users or content).

    And I’ve run into a problem – the default permalink structure for the BBpress plugin is really bizarre. It adds a “forums” slug for the forums area, which is fine and to be expected, but then it also insists on adding an additional “forum” slug before the name of each forum, so that instead of a normal URL like example.com/forums/announcements, you get example.com/forums/forum/announcements, which looks weird and awkward. I tried just removing the forum slug, but that left a double slash in the URL, which my web browser then reduced to a single slash, resulting in a 404 error.

    And for posts within forums, instead of the sort of URL you would normally expect – i.e. for a post in the announcements forum, something like example.com/forums/announcements/welcome, or example.com/forums/announcements/12345 or whatever, you have example.com/forums/topic/welcome – there doesn’t appear to be any way to associate the posts with the actual forum they’re in.

    Is there any way to fix this? Obviously the “forums/forum” thing is the most important – having the completely useless “topic” slug in the post URLs is annoying and pointless, but the “forums/forum” thing makes it look like I was drunk when I set the forums up or something – I really can’t let it go live with a glitch like that in the URLs. But I’d like to fix the topic issue too if possible. Any ideas?

Viewing 11 replies - 76 through 86 (of 86 total)

  • themichaelglenn
    Participant

    @themichaelglenn

    @siparker @natesirrah Thank you both for your work on this plugin! Any news on where the current project stands? I’ve just used siparker’s github plugin and it seems to be work, but if there’s a better, improved version, I’d love to know about it and/or help test it.

    I’m working on migrating a site that I’ve had up for just over a year, from Joomla 3.4 to the current version of WordPress. I use Kunena forums, and by making some slight modifications to siparker’s plugin on github, I was able to set my bbPress URLs to match the structure Kunena uses, namely:

    forum/forumName/topicID-topicName

    (I don’t think they actually use forumName, topicName, etc., that was just the easiest way for me to write it out)

    so that when my forums are set up like this:

    Forum = Final Fantasy VII
    Topic = Cloud’s Limit Break

    I have, for example:

    forum/final-fantasy-vii/143-cloud-s-limit-break

    I should tell you that the only experience I have with php is a couple of 4-hour courses on udemy (in other words, not that much…) Still, by very carefully changing or removing one line at a time, I was able to produce the desired result.

    One thing that didn’t quite work out, though, was forums within a top-level category. For example:

    Top Forum = Square Enix
    Child Forum = Final Fantasy VII
    etc.

    The URL for the child forum is now

    forum/square-enix/final-fantasy-vii

    and I want it to be

    forum/final-fantasy-vii

    The interesting thing is that the topic “Cloud’s Limit Break” still shows as

    forum/final-fantasy-vii/143-cloud-s-limit-break

    which is the URL structure that I want, when someone clicks on a topic, so I’m happy with that.

    But I can’t seem to figure out how to remove the parent or top level forum from the forum URL.

    Everything I’m doing is on localhost, as I don’t want to change my site over to WordPress until I’ve got all the details worked out, and I’m brand new to web development so I’m not sure exactly how to share my code with you guys, or if I need to share it all or perhaps just a part of it? So if you can help me with that, I’ll be happy to share.

    Meanwhile to any bbPress devs following the thread, I want to say thank you for all that you do, and please consider making this permalink option part of the bbPress core!

    I have been wanting to move from Joomla to WordPress for months, as I tend to believe that WordPress is overall easier and better for me and my users, and one of the few things that’s prevented me from making the move was the lack of options in bbPress permalinks. I strongly agree that the URL for a topic should include the name of the forum that topic resides in. (Or at least, admins should be able to choose that option, if they want it.)


    readmenow
    Participant

    @readmenow

    Big thanks @siparker for solving a big problem with BBpress!

    I have also two questions about this plugin:
    1. How can I remove adding -f(number) to forum name? Technically I don’t need this 🙂
    2. Now topic looks like number-NameOfTopic. How change it into NameOfTopic-Number?


    siparker
    Participant

    @siparker

    @themichaelglenn @readmenow
    You are welcome.

    No one actually made any contributions in the end.

    the f- part of the plugin was in order to replicate exactly my old vbulletin urls. So it can be removed if not required for your install.

    We are just putting a few final touches to our bigger plugin for bbpress / buddypress which includes all the various bits of development we have done in order to make bbpress work more like vbulletin. should be launching in the next few weeks. One of the main aprts of this is i want a configurable permalink structure part in there so things can be added / removed from the rewrite rules to provide variations on the hierarchy.

    One thing is the way it deals with forums and subforums.

    for your query about removing the number before the forum name and the structure bit

    The URL for the child forum is now

    forum/square-enix/final-fantasy-vii

    and I want it to be

    forum/final-fantasy-vii

    The interesting thing is that the topic “Cloud’s Limit Break” still shows as

    forum/final-fantasy-vii/143-cloud-s-limit-break

    which is the URL structure that I want, when someone clicks on a topic, so I’m happy with that.

    But I can’t seem to figure out how to remove the parent or top level forum from the forum URL.

    You Cannot currently remove the identifying number from the last url part.

    if it is a forum or a topic or a reply you must have the ID of the final item in the last url part.
    the reason for this is because of the way BBpress saves these as custom post types the id is required to determine what post type it is. forum topic or reply.
    without the ID you cannot govern what is displayed. There is no other (correct me if i am wrong @netweb ) for the system to know if /new is a forum a reply or a topic without the id being passed in.

    We can certainly build it so the Id is after the name rather than before it. i will sort that out so it works.

    So you can have

    forum/subforum/ID-topic-name
    or
    forum/ID-topic-name
    or
    forum/subforum/topic-name-ID

    for topics to be shown. basically the pieces preceding the final topic item are not really relevant its just what you want in there. you can have as much or as little hierarchy as you want. So long as the ID is in the last url part.

    however you cannot have

    forum/subforum-name/ because we must have an ID

    so it would always be

    forum/ID-sub-forum-name/ or forum/subforum-name-ID/

    IF you check you can actually remove mostly anything before the final url part which contains the ID. discussion on that in github where i explain why this is not an SEO problem. its how most things work in WP.

    If you want to post your current forum structures here i will create permalink optioins to replicate these. or rewrites to deal with moving from them to the new structure.

    I have the Kunena one from above

    forum/forumName/topicID-topicName


    themichaelglenn
    Participant

    @themichaelglenn

    Thanks @siparker

    I’m actually good with forum/subforum/ID-topic-name

    (which for all purposes is the same as the Kunena forum/forumName/topicID-topic-name

    FWIW, I have bbPress set so the “Forums” slug is NOT pre-fixed, so my bbPress URL structure for any given forum is ‘forum/subforum-name’ without any ID, and I removed the lines in your plugin that assign an ID to anything other than the topic name, and everything still works for me.

    (It’s only when I try to remove ID from the topic-name part, that the URLs no longer work – and now I know why) 🙂


    siparker
    Participant

    @siparker

    @themichaelglenn thats interesting. i know we trried various ways to get the url;s working for topics with no ID but i didnt try with the normal forum structures. Will have to look into that.

    Could you post the changes on github perhaps just in an issue discussion.


    themichaelglenn
    Participant

    @themichaelglenn

    Yeah I’ll try to do that later today. Not sure I know how to use github, as your plugin is the first time I’ve been on it. 🙂 But hopefully I can figure it out.


    themichaelglenn
    Participant

    @themichaelglenn

    Alright, I probably didn’t do this in the best way, but I figured out how to “fork” your github code and create a separate branch but it’s under my username (I didn’t know if it’s okay to just go creating branches in someone else’s repository, so I just set up in my own):

    https://github.com/themichaelglenn/bbpress-vbulletin-permalink/tree/no-f-s-or-id-s-in-forums

    Again I need to make clear that I do not know what I’m doing – but whatever I did is working on my localhost and on my test site (which site will only be up long enough to test everything on an actual server, so no link to that site, sorry)

    I don’t know if I would still get the topic URLs forum/forum-name/ID-topic-name if I kept removing more code, to get it down to where we were only rewriting the topic URLs? I’d like to try that but I don’t know how much more I can remove before the plugin just stops working altogether.


    consultjoseph
    Participant

    @consultjoseph

    @themichaelglenn I tried out your version but it brought problems which weren’t there in the original version.

    Now, when I go to a sub-topic and click on a new thread, it says “PAGE NOT FOUND” despite it having appeared on the previous version in GitHub.

    You can check it out here: http://startecareer.com/forum/say-hi/


    siparker
    Participant

    @siparker

    @consultjoseph I think this is down to the id not being available.

    We are trying various dfifferent ways of doign this now with different url structures. Once we have a solution we will release it as part of the Coffeeblack BBpress extended plugin.

    the default code still works for search engine friendly urls but there are a load of other bits i am working on too. like auto setup of urls to match default vbulletin, default kunena, default phpbb and so on. so you can just choose the format from the admin side and it will just work.

    Also looking at a sensible way to auto redirect all old urls to the new ones. Which is a harder propsective change but nonetheless it should be done so this solution can work for everyone.


    themichaelglenn
    Participant

    @themichaelglenn

    @consultjoseph @siparker Sorry it took me so long to respond to you guys.

    I am using the version of this plugin I put on Github in a beta test of a site I’m moving from Joomla to WordPress. I’m using WordPress 4.6.1 and bbPress 2.5.11.6121 and am using a child theme of Twentysixteen.

    The biggest thing is that with the version of the plugin I’m using, bbPress Settings need to be adjusted:

    1. Go into Forum Settings and set “Forum Root” to “forums”
    2. UN-check Forum Prefix – you do NOT want to prefix all forum content the Forum Root Slug
    3. Make sure that the Single Forum Slug for “Forum” is “forum”

    Next, go into Permalink Settings:

    1. Under Common Settings, select “Post Name”
    2. Save changes

    If you don’t set or RESET your permalinks, you will get 404s! But if you reset your permalinks after activating the plugin, everything will work.

    I expect to take my beta site live within a week or so; when I do I’ll provide a link to the permanent live site so you can see the bbPress URLs in action.


    Nick
    Participant

    @nickchomey

    Hi folks, I just discovered this thread and checked out the various github repos, but the plugins are all 5+ years old. Before I install them, does anyone know if they still work?

Viewing 11 replies - 76 through 86 (of 86 total)
  • You must be logged in to reply to this topic.
Skip to toolbar