Forums

Join
bbPress Support ForumsTroubleshootingPretty Permalinks Not Working

Info

Pretty Permalinks Not Working

  1. I have now installed wordpress2.3 at http://new.tnlotteryresults.com/ and bbpress 0.8.3 at http://talk.tnlotteryresults.com/ They are located in two physically separate directories using two different databases with no .htaccess in any parent directory. Matter of fact, all parent directories between root and each of the sites are empty. Pretty permalinks work on http://new.tnlotteryresults.com/ and fail on http://talk.tnlotteryresults.com/

    I have edited the .htaccess with both methods shown in the installation instructions as well as making sure that I had 'slugs' in the config.php

    Why does WordPress implement pretty permalinks so easily and bbpress is so resistant?

  2. Can you post your .htaccess?

  3. This is the most recent .htaccess based upon /bb-admin/rewrite-rules.php:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^forum/([^/]+)/page/([0-9]+)/?$ /forum.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^forum/([^/]+)/?$ /forum.php?id=$1 [L,QSA]
    RewriteRule ^topic/([^/]+)/page/([0-9]+)/?$ /topic.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^topic/([^/]+)/?$ /topic.php?id=$1 [L,QSA]
    RewriteRule ^tags/([^/]+)/page/([0-9]+)/?$ /tags.php?tag=$1&page=$2 [L,QSA]
    RewriteRule ^tags/([^/]+)/?$ /tags.php?tag=$1 [L,QSA]
    RewriteRule ^tags/?$ /tags.php [L,QSA]
    RewriteRule ^profile/([^/]+)/page/([0-9]+)/?$ /profile.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^profile/([^/]+)/([^/]+)/?$ /profile.php?id=$1&tab=$2 [L,QSA]
    RewriteRule ^profile/([^/]+)/([^/]+)/page/([0-9]+)/?$ /profile.php?id=$1&tab=$2&page=$3 [L,QSA]
    RewriteRule ^profile/([^/]+)/?$ /profile.php?id=$1 [L,QSA]
    RewriteRule ^view/([^/]+)/page/([0-9]+)/?$ /view.php?view=$1&page=$2 [L,QSA]
    RewriteRule ^view/([^/]+)/?$ /view.php?view=$1 [L,QSA]
    RewriteRule ^rss/?$ /rss.php [L,QSA]
    RewriteRule ^rss/forum/([^/]+)/?$ /rss.php?forum=$1 [L,QSA]
    RewriteRule ^rss/topic/([^/]+)/?$ /rss.php?topic=$1 [L,QSA]
    RewriteRule ^rss/tags/([^/]+)/?$ /rss.php?tag=$1 [L,QSA]
    RewriteRule ^rss/profile/([^/]+)/?$ /rss.php?profile=$1 [L,QSA]
    </IfModule>

    I also tried:
    Options +MultiViews

    And here's the config.php
    <?php

    // ** MySQL settings ** //
    define('BBDB_NAME', 'CORRECT'); // The name of the database
    define('BBDB_USER', 'CORRECT'); // Your MySQL username
    define('BBDB_PASSWORD', 'CORRECT'); // ...and password
    define('BBDB_HOST', 'CORRECT'); // 99% chance you won't need to change these last few

    define('BBDB_CHARSET', 'utf8'); // If you are *upgrading*, and your old config.php does
    define('BBDB_COLLATE', ''); // not have these two contstants in them, DO NOT define them
    // If you are installing for the first time, leave them here

    // Change the prefix if you want to have multiple forums in a single database.
    $bb_table_prefix = 'bb_'; // Only letters, numbers and underscores please!

    // The full URL of your bbPress install
    $bb->uri = 'http://talk.tnlotteryresults.com/';

    // What are you going to call me?
    $bb->name = 'Discuss the Tennessee Lottery';

    // This must be set before you run the install script.
    $bb->admin_email = 'juggler@gmail.com';

    // Set to true if you want pretty permalinks, set to 'slugs' if you want to use slug based pretty permalinks.
    $bb->mod_rewrite = 'slugs';

    // The number of topics that show on each page.
    $bb->page_topics = 30;

    // A user can edit a post for this many minutes after submitting.
    $bb->edit_lock = 60;

    // Your timezone offset. Example: -7 for Pacific Daylight Time.
    $bb->gmt_offset = -5;

    // Change this to localize bbPress. A corresponding MO file for the
    // chosen language must be installed to bb-includes/languages.
    // For example, install de.mo to bb-includes/languages and set BBLANG to 'de'
    // to enable German language support.
    define('BBLANG', '');

    // Your Akismet Key. You do not need a key to run bbPress, but if you want to take advantage
    // of Akismet's powerful spam blocking, you'll need one. You can get an Akismet key at
    // http://wordpress.com/api-keys/
    $bb->akismet_key = '0123456789ab'; // Example: '0123456789ab'

    // The rest is only useful if you are integrating bbPress with WordPress.
    // If you're not, just leave it as it is.

    $bb->wp_table_prefix = ''; // WordPress table prefix. Example: 'wp_';
    $bb->wp_home = 'http://new.tnlotteryresults.com'; // WordPress - Options->General: Blog address (URL) // Example: 'http://example.com'
    $bb->wp_siteurl = 'http://new.tnlotteryresults.com'; // WordPress - Options->General: WordPress address (URL) // Example: 'http://example.com'

    //The following allow users from the WordPress blog to mix with the bbpress users
    define('USER_BBDB_NAME','CORRECT_BUT_DIFFERENT_THAN_ABOVE');
    define('USER_BBDB_USER','CORRECT_BUT_DIFFERENT_THAN_ABOVE');
    define('USER_BBDB_PASSWORD','CORRECT_BUT_DIFFERENT_THAN_ABOVE');
    define('USER_BBDB_HOST','CORRECT_BUT_DIFFERENT_THAN_ABOVE');

    /* Stop editing */

    if ( !defined('BBPATH') )
    define('BBPATH', dirname(__FILE__) . '/' );
    require_once( BBPATH . 'bb-settings.php' );

    ?>

    Thanks for gandering!

  4. To eliminate WordPress as a possible problem, I have tried a fresh install of BBPress 0.8.3 in a new directory ~/make2for1_com/ for a throwaway domain I had laying around http://make2for1.com/ The database is a freshly created MySQL 4 db. PHP is using version 4.4.7 The .htaccess uses the code generated with http://make2for1.com//bb-admin/rewrite-rules.php and nothing else. The config is the sample file with all the appropriate blanks filled in and nothing more.
    $bb->mod_rewrite = 'slugs'; is set.

    Trying to get to a profiles produces a 404. Trying to read a discussion produces a 404. If I change $bb->mod_rewrite = false; it works.

  5. djuggler

    any luck so far?

    I am also with 1and1 hosting.

  6. mvh: None yet. I'm going to start digging into code and rewrite rules in my spare time. http://make2for1.com/ is about as basic an install of bbpress as can be done. Implementing bbpress shouldn't be this difficult.

    Obviously mod_rewrite at 1and1 works fine since WordPress pretty permalinks work. I use them at http://realityme.net/ with no problems.

    If I get a solution, I will definitely post it here.

  7. Could you test your mod_rewrite is really working on http://make2for1.com/
    Please add the following to the top of .htaccess

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule redir youcantfindme
    </IfModule>

    Use browser and navigate to http://make2for1.com/redir
    If you read /youcantfindme was not found, then mod_rewrite does work.

  8. Performed livibetter's test. mod_rewrite undeniable works.

  9. (edit: How did you know it was working? I didn't notice your 404 doesn't give the url information. Please use the following code for testing

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule redir youcantfindme [R=301,L]
    </IfModule>

    This time please check the browser's address, and make sure you read http://make2for1.com/youcantfindme. If you do read that, please continue to the following testing.)

    Please place $bb->debug = 1; to your config.php
    Add exit; right after bb_repermalink(); in forum.php like

    <?php
    
    require_once('./bb-load.php');
    
    $forum_id = 0;
    
    bb_repermalink();
    exit;

    Then navigate to http://make2for1.com/forum.php?id=1 and http://www.make2for1.com/forum/general, once you done, post the result and DO NOT REMOVE this modification (allow us to check it).

  10. I just ran into this myself... Didn't think to check here for a workaround. I have bbpress installed as /forum/ and my approach was to add an htaccess with the following:

    RewriteEngine On
    RewriteBase /forum/

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^/]+)/(.*)?$ /forum/$1.php [PT,QSA]

    It seems to be working fine.

  11. Where did you put that .htaccess, in the parent folder or the forum folder?

  12. livibetter: You are right. I reversed the modifications after testing. They are in place now. A side note, if the directory 'youcantfindme' does not exist then http://make2for1.com/redir returns:

    "Error 404 - Not found
    Your browser can't find the document corresponding to the URL you typed in."

    And shows http://make2for1.com/youcantfindme in the address field of the browser. If I create the directory 'youcantfindme' and put an index file in there then http://make2for1.com/redir does indeed show the index file and the address changes to http://make2for1.com/youcantfindme.

    The debug test shows the following:
    ----
    http://make2for1.com/forum.php?id=1

    REQUEST_URI: string(15) "/forum.php?id=1"
    should be: string(14) "/forum/general"
    full permalink: string(38) "http://www.make2for1.com/forum/general"
    PATH_INFO: string(10) "/forum.php"

    -----
    http://www.make2for1.com/forum/general

    Error 404 - Not found
    Your browser can't find the document corresponding to the URL you typed in.

    [That was with the RewriteRule redir youcantfindme [R=301,L] .htaccess]

    -----
    http://www.make2for1.com/forum/general
    [with the actual .htaccess generated with http://make2for1.com/bb-admin/rewrite-rules.php

    also
    Error 404 - Not found
    Your browser can't find the document corresponding to the URL you typed in.

    ----
    I have returned the .htaccess back to
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule redir youcantfindme [R=301,L]
    </IfModule>
    so you can see the http://make2for1.com/redir work

    If anyone wants to play with this, I'll happily setup an ftp account. Email juggler@gmail.com

    I have left the changes in place.

    Thanks.
    Doug

  13. Although "redir" indicated mod_rewrite working. But, that doesn't seem to be working on "http://www.make2for1.com/forum/general" testing, or it would output similar result like "http://make2for1.com/forum.php?id=1" did.

    No idea why "RewriteRule ^forum/([^/]+)/?$ /forum.php?id=$1 [L,QSA]" didn't match on your forums.

    What was the file path of 404 in web server's log (using rewrite rules), when accessed "http://www.make2for1.com/forum/general"?

  14. any luck so far djuggler?

    i've been trying the suggestions but so far, its still the same =(

  15. this is what worked for me:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^forum/([^/]+)/page/([0-9]+)/?$ /forum.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^forum/([^/]+)/?$ /forum.php?id=$1 [L,QSA]
    RewriteRule ^topic/([^/]+)/page/([0-9]+)/?$ /topic.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^topic/([^/]+)/?$ /topic.php?id=$1 [L,QSA]
    RewriteRule ^tags/([^/]+)/page/([0-9]+)/?$ /tags.php?tag=$1&page=$2 [L,QSA]
    RewriteRule ^tags/([^/]+)/?$ /tags.php?tag=$1 [L,QSA]
    RewriteRule ^tags/?$ /tags.php [L,QSA]
    RewriteRule ^profile/([^/]+)/page/([0-9]+)/?$ /profile.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^profile/([^/]+)/([^/]+)/?$ /profile.php?id=$1&tab=$2 [L,QSA]
    RewriteRule ^profile/([^/]+)/([^/]+)/page/([0-9]+)/?$ /profile.php?id=$1&tab=$2&page=$3 [L,QSA]
    RewriteRule ^profile/([^/]+)/?$ /profile.php?id=$1 [L,QSA]
    RewriteRule ^view/([^/]+)/page/([0-9]+)/?$ /view.php?view=$1&page=$2 [L,QSA]
    RewriteRule ^view/([^/]+)/?$ /view.php?view=$1 [L,QSA]
    RewriteRule ^rss/?$ /rss.php [L,QSA]
    RewriteRule ^rss/forum/([^/]+)/?$ /rss.php?forum=$1 [L,QSA]
    RewriteRule ^rss/topic/([^/]+)/?$ /rss.php?topic=$1 [L,QSA]
    RewriteRule ^rss/tags/([^/]+)/?$ /rss.php?tag=$1 [L,QSA]
    RewriteRule ^rss/profile/([^/]+)/?$ /rss.php?profile=$1 [L,QSA]
    </IfModule>

    hope that helps someone

  16. Ok, I just realized that what worked for me only applied to a 'clean' top-level install, and what people are having issues with is installing bbpress in example.com/forums/, because example.com's .htaccess is over-riding example.com/forums/ 's .htaccess file.

    So here's my example.com (permalinks work great):

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    chmod: 644

    And here's my example.com/forums .htaccess content:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /forum/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^/]+)/(.*)?$ /forum/$1.php [PT,QSA]
    </IfModule>

    Any ideas?

    Thanks

  17. **update**: just found http://bbpress.org/documentation/faq/#pretty-permalinks
    after looking for days, don't know why it took so long to find. this did the trick!

    ----------------------------
    Also having a problem with pretty permalinks. i am on bluehost with the following:

    wordpress 2.5.1 installed at example.com/blog
    bbpress 0.9.0.2 installed at example.com/bb

    i do have my wp akismet key applied in bbpress, but other than that no wp integration. bbpress works fine until i activate pretty permalinks. at that time, i can see all of my topics & stuff, but i just get 404 when i try to get to them.

    here's an interesting thing i discovered: both installed to my site via SimpleScripts. WP works fine, but bb appears to have no .htaccess file at all. i do see one in attached to a theme, but that's it, and apparently not useful there.

    since this seems to be the issue, sort of narrowed down, i created an .htaccess file using the code shown by jethro, but i know there's something missing. it didn't break my site, but i couldn't even get to admin area to see if i could make the permalinks work.

    i'm not a programmer, but if anyone can tell me what code i need to have in the .htaccess file, i can make the file and upload it.

    thanks!

  18. @ stitchadoodle

    The rules are output to screen when you go to http://example.com/bb/bb-admin/rewrite-rules.php

    Obviously replace example.com with your domain.

  19. Wait, so was this ever resolved after a year?
    With WordPress in the root and bbPress in a sub-directory (ie. /forums/) can they both have pretty permalinks?

    I have an idea if not - simple edit the webroot wordpress htaccess like so:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} !^/forums/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    where /forums/ is the install path of bbpres underneath wordpress. Remember you still need the local htaccess for bbpress in it's own folder.

  20. I just now got this working! The solution is posted at http://bbpress.org/forums/topic/dropping-multiviews-support#post-16050

    Quite simply, turn 1and1 hosting has MultiViews on by default and it must be turned off in .htaccess with:
    Options -MultiViews

    Then add the /bb-admin/rewrite-rules.php mod_rewrite AFTER the Options -MultiViews.

    That was too simple to take this long to resolve.

  21. i got my pretty permalinks to work fine.... almost
    http://www.djvibe.com/content/forums/

    One little glitch though. I cant access any of my forums directly. It renames all of the forum links to /forum.

    the links look like this:
    ex. http://www.djvibe.com/content/forums/forum/

    which returns an error.

    My htaccess looks like this.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /content/forums/
    RewriteRule ^forum/([^/]+)/page/([0-9]+)/?$ /content/forums/forum.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^forum/([^/]+)/?$ /content/forums/forum.php?id=$1 [L,QSA]
    RewriteRule ^topic/([^/]+)/page/([0-9]+)/?$ /content/forums/topic.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^topic/([^/]+)/?$ /content/forums/topic.php?id=$1 [L,QSA]
    RewriteRule ^tags/([^/]+)/page/([0-9]+)/?$ /content/forums/tags.php?tag=$1&page=$2 [L,QSA]
    RewriteRule ^tags/([^/]+)/?$ /content/forums/tags.php?tag=$1 [L,QSA]
    RewriteRule ^tags/?$ /content/forums/tags.php [L,QSA]
    RewriteRule ^profile/([^/]+)/page/([0-9]+)/?$ /content/forums/profile.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^profile/([^/]+)/([^/]+)/?$ /content/forums/profile.php?id=$1&tab=$2 [L,QSA]
    RewriteRule ^profile/([^/]+)/([^/]+)/page/([0-9]+)/?$ /content/forums/profile.php?id=$1&tab=$2&page=$3 [L,QSA]
    RewriteRule ^profile/([^/]+)/?$ /content/forums/profile.php?id=$1 [L,QSA]
    RewriteRule ^profile/?$ /content/forums/profile.php [L,QSA]
    RewriteRule ^view/([^/]+)/page/([0-9]+)/?$ /content/forums/view.php?view=$1&page=$2 [L,QSA]
    RewriteRule ^view/([^/]+)/?$ /content/forums/view.php?view=$1 [L,QSA]
    RewriteRule ^rss/?$ /content/forums/rss.php [L,QSA]
    RewriteRule ^rss/topics/?$ /content/forums/rss.php?topics=1 [L,QSA]
    RewriteRule ^rss/forum/([^/]+)/?$ /content/forums/rss.php?forum=$1 [L,QSA]
    RewriteRule ^rss/forum/([^/]+)/topics/?$ /content/forums/rss.php?forum=$1&topics=1 [L,QSA]
    RewriteRule ^rss/topic/([^/]+)/?$ /content/forums/rss.php?topic=$1 [L,QSA]
    RewriteRule ^rss/tags/([^/]+)/?$ /content/forums/rss.php?tag=$1 [L,QSA]
    RewriteRule ^rss/profile/([^/]+)/?$ /content/forums/rss.php?profile=$1 [L,QSA]
    RewriteRule ^rss/view/([^/]+)/?$ /content/forums/rss.php?view=$1 [L,QSA]
    </IfModule>

    can't seem to figure it.. any help would be appreciated.
    graham@djvibe.com

  22. I had the same problem with pretty permalink.

    Background:

    Main site = http://www.site.com
    Blog = http://www.site.com/blog (WP 2.8)
    Forum = http://www.site.com/forum (bbPress 0.9.06)

    I installed the blog few weeks ago and didn't touch apart of posting a "hello world". Wp gave me a message on that time to enter this on root htaccess -

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>

    I must mention that the htaccess had already

    Options +FollowSymLinks
    RewriteEngine on

    Then I installed the forum today. After activating the name based permalink it gave me 404 message. I deleted the "+FollowSymLinks" from the htaccess and put -

    Options +Multiviews

    It worked fine for few hours but it started showing 404 again. After going through various posts in here I decided not to change the Multiviews as my hosting already mod_rewrite enabled.

    I made another htaccess just for the forum,which look like this -

    Options +FollowSymLinks
    RewriteEngine on

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /forum/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /forum/index.php [L]
    </IfModule>

    The pretty permalink is working at the moment. Hopefully it will be working in future too.

  23. You must log in to post.