[bbDev] Permalinks Plugin - Changing Mod Rewrite Rules
info at swing-sets.us
info at swing-sets.us
Tue Mar 13 19:36:30 GMT 2007
Hello,
I am trying to change the bbPress permalinks but I am stuck when it
comes to paggination. I've already written a plugin and I have a
working example at www.dfur.com
My permalinks structure idea is
www.example.com/forum_name
www.example.com/forum_name/page/2 for pagination
www.example.com/forum_name/topic_id
www.example.com/forum_name/topic_id/page/2 for pagination
Pagination can be change from page/2 to page_2, same thing with the topic_id.
There are 2 reasons for witch I am working on this:
1. www.example.com/forum_name/topic_id will offer better usability and
help with the search engine rankings
2. A custom permalink structure will allow other platform forums
owners to switch to bbPress AND keep their current linking structure.
I have a PHPBB forum that I want to move to bbPress but if I will
loose all the links there will be a nightmare restoring all my rakings.
I?ve written a plugin that changes the forum links to
www.example.com/forum_name.
You can see a working example on my test site www.dfur.com, the plugin
can be downloaded from http://bbpress.org/forums/topic/771
To make this work I?ve added in to following link for each topic of my
site in htaccess
RewriteRule ^designer_furniture/topic([0-9]+)$ /topic.php?id=$1 [L,QSA]
The problem comes to pagination. Please see
http://www.dfur.com/designer_furniture
The ?page 2? pagination should be
http://www.dfur.com/designer_furniture/page/2 However this link does
not works. The 301 from bb_repermalink function in
bb-includes/functions.php redirect me back to the forum category.
From what I?ve understood the bb_repermalink makes a check to see if
the links is correctly created: if - ( is_forum() )? $permalink =
get_forum_link( $permalink, $page ); and if this fails it gives the
301 redirect.
From my point of view creating a 301 (permanently moved) is not a
good move for search engines, especially Google. The 301 may cause a
duplicate page issue with Google. The standard recommendation for a
non existing page is a 404 with a noindex, nofollow. I see that the
wordpress and bbpress forums have the 404 but the regular bbpress
powered forums do not have this option.
Anyway I need some help finishing this plugin. Why am I being
redirected and how can I avoid that? How can I bypass this 301 and
what triggers it?
Thank you,
Mircea Piturca.
More information about the bbDev
mailing list