[bbDev] Permalinks Plugin - Changing Mod Rewrite Rules

info at swing-sets.us info at swing-sets.us
Wed Mar 14 14:23:18 GMT 2007


Thanx for your response.

> You'll also need above that:
> RewriteRule ^designer_furniture/topic([0-9]+)/page/([0-9]+)/?$ /
> topic.php?id=$1&page=$2

I've added this into my htaccess but I get the 301 redirect from
bb_repermalink. You can see the paggination from
http://www.dfur.com/designer_furniture

I guess that this is due to the way I've created my forum link into
"function get_forum_link" from bb-includes/template-functions.php

From:
$link = bb_get_option( 'uri' ) . "forum-$forum->forum_id" . ( 1 < $page ?
"/page/$page" : '' ) . ".html";}

I've modifyed it to:
$link = bb_get_option('uri') . "$forum->forum_name" . ( 1 < $page ?
"/page/$page"  : '' );}

Is there a way to make the bb_repermalink not trigger the 301 and accept
this new link I've created?

I thing that Sam's plugin will be very useful, however I am not quite sure
how flexible it will be. I know lots of webmasters that want to switch
from PHPBB to bbPress (so am I) but do not want to loose their existing
current link structure.

Regards,
Mircea.




> On Mar 13, 2007, at 12:36 PM, info at swing-sets.us wrote:
>> 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.
>
> You'll also need above that:
> RewriteRule ^designer_furniture/topic([0-9]+)/page/([0-9]+)/?$ /
> topic.php?id=$1&page=$2
>
>> 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.
>
> The bb_repermalink function is designed to take urls like
> example.com/?forum_id=1 (a URL that definitively points to a valid
> page but does so with an incorrect URL) and turn them into
> example.com/forum/1 (the canonical URL for that page).
>
> For that, 301 is the correct behavior.  301s should not cause
> duplication (as long as instead 404 when the page does not exist OR
> we 404 after being redirected to page that does not exist).
>
> If we don't eventually 404 on non-existent pages, we should.
>
> Currently bb_repermalink is very inflexible, something I hope which a
> patch Sam Bauers is working on will fix :)
>
> Michael
> _______________________________________________
> bbDev mailing list
> bbDev at lists.bbpress.org
> http://lists.bbpress.org/mailman/listinfo/bbdev
>



More information about the bbDev mailing list