Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: nicer slug url rewrite plugin (done!)


Dailytalker
Member

@dailytalker

Hi, I’ve just followed your instructions and was also able to remove “forum” and “topic” from the urls.

But something is wrong because the pages cannot be found. This is my rewrite code (it is a bit different from your code because I am using the newest version of bbpress):

# BEGIN bbPress

Options -MultiViews

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /forum/

Options +FollowSymlinks

RewriteRule ^page/([0-9]+)/?$ /index.php?page=$1 [L,QSA]

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

RewriteRule ^forum/([^/]+)/?$ /forum.php?id=$1 [L,QSA]

RewriteRule ^forum/?$ [R=302,L,QSA]

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

RewriteRule ^topic/([^/]+)/?$ /topic.php?id=$1 [L,QSA]

RewriteRule ^topic/?$ /forum/ [R=302,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 ^profile/?$ profile.php [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/topics/?$ rss.php?topics=1 [L,QSA]

RewriteRule ^rss/forum/([^/]+)/?$ rss.php?forum=$1 [L,QSA]

RewriteRule ^rss/forum/([^/]+)/topics/?$ rss.php?forum=$1&topics=1 [L,QSA]

RewriteRule ^rss/topic/([^/]+)/?$ rss.php?topic=$1 [L,QSA]

RewriteRule ^rss/tags/([^/]+)/?$ rss.php?tag=$1 [L,QSA]

RewriteRule ^rss/tags/([^/]+)/topics/?$ /forum/rss.php?tag=$1&topics=1 [L,QSA]

RewriteRule ^rss/profile/([^/]+)/?$ rss.php?profile=$1 [L,QSA]

RewriteRule ^rss/view/([^/]+)/?$ /forum/rss.php?view=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^.*$ /forum/index.php [L]

</IfModule>

# END bbPress

Probably I made something wrong with point four where you say that the lines 46 and 48 have to be switched. What do I actually have do do there?

Quote: “4. Open up bb-post.php at the root of your bbPress install and simply switch lines number 46 and 48”

Is it this code?

$link = get_post_link($post_id);

$topic = get_topic( $topic_id, false );

Skip to toolbar