bbPress

Simple, Fast, Elegant

bbPress support forums » Troubleshooting

Pretty Permalinks Not Working

(49 posts)
  • Started 1 year ago by laemo
  • Latest reply from sambauers
  • This topic is not resolved
  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?

    Posted 6 months ago #
  2. Can you post your .htaccess?

    Posted 6 months ago #
  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!

    Posted 6 months ago #
  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.

    Posted 6 months ago #
  5. mvh
    Member

    djuggler

    any luck so far?

    I am also with 1and1 hosting.

    Posted 6 months ago #
  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.

    Posted 6 months ago #
  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.

    Posted 6 months ago #
  8. Performed livibetter's test. mod_rewrite undeniable works.

    Posted 6 months ago #
  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).

    Posted 6 months ago #
  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.

    Posted 6 months ago #
  11. Where did you put that .htaccess, in the parent folder or the forum folder?

    Posted 6 months ago #
  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

    Posted 6 months ago #
  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"?

    Posted 6 months ago #
  14. italways
    Member


    Posted 6 months ago #
  15. mvh
    Member

    any luck so far djuggler?

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

    Posted 6 months ago #
  16. 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

    Posted 5 months ago #
  17. 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

    Posted 2 months ago #
  18. **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!

    Posted 2 months ago #
  19. @ 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.

    Posted 1 month ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.