Troubleshooting/Pretty permalinks

From bbPulp

Jump to: navigation, search

Contents

[edit] Introduction

There three types of links can be used in bbPress. 1) Query style link likes /topic.php?id=1, 2) numeric permalink likes /topic/17 and 3) slug-based permalink likes /topic/i-like-bbpress. First one requires nothing, but the rest two types need .htaccess to be configured correctly.

You can configure link type in config.php with 1) $bb->mod_rewrite = false;, 2) $bb->mod_rewrite = true; and 3) $bb->mod_rewrite = 'slugs;, respectively.

[edit] Basic checks

[edit] Have you created .htaccess

There are two ways to configure it. First one is only require one line, which is

Options +MultiViews

If this is not working, the second way is getting rewrite rules from http://yoursite.com/bb-folder/bb-admin/rewrite-rules.php. Use you browser to link to it, then you will get something like:

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

[edit] Does forum work without pretty permalinks

If you have a correct .htaccess, but still can't work. Please make sure you forum is working when sets $bb->mod_rewrite = false; in config.php. It is better to remove .htaccess while you are testing.

[edit] Does MultiViews option work

When you set MultiViews (only one setting in .htaccess) and get 500 Internal server error, that means you are not allow to override that option. You have one option left, mod_rewrite.

When you set MultiViews and get 404 Not found error on forum or topic page but not front page, that may not be bbPress problem. .htaccess may not be loaded if AllowOverride set to None in web server configuration file (normal user is unable to access it). There is a quick way to test that, write some random text in your .htaccess, like j84hf9hs98hf323. If you get 500 error, and you read j84hf9hs98hf323 in web server's log. That means .htaccess was trying to be loaded, but failed because that random text.

[edit] Does mod_rewrite work

When you set all rewrite rules and get 500 Internal server error on "RewriteEngine not allowed here", please use $bb->mod_rewrite = false; or ask web server administrator.

When you set all rewrite rules and get 403 Forbidden error on "Options FollowSymLinks or SymLinksIfOwnerMatch is off", please add Options +FollowSymLinks to .htaccess.

[edit] Troubleshoot

[edit] Still get 404

Please add $bb->debug = 1; to your config.php, then try to open a forum page or topic page, you should able to read something like:

REQUEST_URI:	string '/bb-folder/forum/first-forum' (length=28)
should be:	string '/bb-folder/forum/first-forum' (length=28)
full permalink:	string 'http://yoursite.com/bb-folder/forum/first-forum' (length=47)
PATH_INFO:	null

Post it on forum with some informations about bbPress install and you got while troubleshooting.

Personal tools