Skip to:
Content
Pages
Categories
Search
Top
Bottom

Cutting /forum/forum/ down to /forum/

  • The base URL of my forum is example.com/forum/

    If I then browse to a specific forum the URL is:

    example.com/forum/forum/forumname

    But I’d rather it was:

    example.com/forum/forumname

    Is there anything I can do to make it follow the later format?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Looks like you have a directory titled “forum” within your forum directory.

    No, that’s expected behavior:

    https://bbpress.org/forums/forum/installation


    Rohan Kapoor
    Member

    @rohan_kapoor

    That is standard core behavior right now. You would have to hack the core files or come up with a plugin to go around it.


    biggerbyfar
    Member

    @biggerbyfar

    I couldn’t find where is it described as expected behaviour. This does seem pretty weird?

    It would be more accurate if it read “forums/sub-forum/topic” but it really is just a minor cosmetic issue.


    Mark
    Member

    @delayedinsanity

    It’s actually a pretty simple hack, though I caution you that I worked it out in the last five minutes.

    First, modify the following three lines of your bbpress .htaccess;

    RewriteRule ^forum/([^/]+)/page/([0-9]+)/?$ /bbpress/forum.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^forum/([^/]+)/?$ /bbpress/forum.php?id=$1 [L,QSA]
    RewriteRule ^forum/?$ /bbpress/ [R=302,L,QSA]

    change ^forum/ to whatever you want the permalink to be, such as ^sub/ or ^purplepolkadots/, whatever works for you. Then open functions.bb-template.php and go to line 711 inside function get_forum_link() (line numbers may vary). It should look something like:

    $link = bb_get_uri('forum/' . $forum->$column . $page, null, $context);

    …and change ‘forum/’ to whatever you put in your .htaccess – this seemed to work for me immediately, however as I mentioned, I haven’t done any thorough testing of it.


    Ryan Hellyer
    Participant

    @ryanhellyer

    Sam told me this is a throwback to some of the older versions of the software. Hopefully it will be fixed in a future version of bbPress.

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