Skip to:
Content
Pages
Categories
Search
Top
Bottom

Redirection to new bbPress board?


  • fontadoni
    Participant

    @fontadoni

    Now that I converted my board from phpbb to bbpress I need to know how to redirect the old stuff to where the new board is (so people coming from google can at least get to the new bbPress index and not just get a 401 – which is what is currently happening). I suppose I need to do this in my htaccess file. Does anyone have the code for this? Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You mean to just redirect one folder to another?

    Pretend your old forum was at http://www.domain.com/phpbb2 and the new one is at http://www.domain.com/bbpress

    Delete the phpbb2 folder and in your .htaccess add this:

    RewriteRule ^phpbb2(.*)$ http://www.domain.com/bbpress/ [L,R=301]

    That will make what’s called a Permanent redirect, and in theory teach site crawlers what’s up. Mind, a 401 is for unauthorized access, which is an odd error to get.


    fontadoni
    Participant

    @fontadoni

    Hello Ipstenu, thanks for your response. Sorry, I should have mentioned that the new bbpress board is actually on the same folder as the previous phpbb one (/forum), however, I get people coming from google trying to find phpbb pages like:

    /forum/viewtopic.php?p=66sid=c72c343df3c37339b4d5094a1296566d

    ,but the new pages now look more like: forum/topic.php?id=38 on bbpress.

    I was wondering if there’s a code I can add so people coming from google at least can be redirected to the forum’s index, right now they’re getting a 404 (sorry, I said 401 previously) because the old page can’t be found.

    At least until google indexes everything again.

    Thanks.


    chrishajer
    Participant

    @chrishajer

    You would need to map all the old phpBB URLs to new bbPress URLs, one to one, since it doesn’t look like there’s an easy way to create a rewrite rule. Once you have all the URLs before and after, you can create 301 redirect rules in your .htaccess file.

    At a guess…

    RewriteRule ^forum/faq(.*)$ http://www.domain.com/forum/ [L,R=301]
    RewriteRule ^forum/mcp(.*)$ http://www.domain.com/forum/ [L,R=301]
    RewriteRule ^forum/member(.*)$ http://www.domain.com/forum/ [L,R=301]
    RewriteRule ^forum/search(.*)$ http://www.domain.com/forum/ [L,R=301]
    RewriteRule ^forum/ucp(.*)$ http://www.domain.com/forum/ [L,R=301]
    RewriteRule ^forum/view(.*)$ http://www.domain.com/forum/ [L,R=301]

    That’s the majority of the links, I think. At least the ones off the main page of a forum.


    fontadoni
    Participant

    @fontadoni

    Thanks Chris and Ipstenu for your reply. I will give it a try and report back!


    fontadoni
    Participant

    @fontadoni

    What would the RewriteCond be in this case?


    fontadoni
    Participant

    @fontadoni

    Any clue on what the RewriteCond code for this would be? I’ve been trying to look this up but haven’t found anything yet.


    _ck_
    Participant

    @_ck_

    You shouldn’t need a RewriteCond in that case, the RewriteRule can work without it if it’s simple enough.

    If you are using the .htaccess inside of the /forum/ directory though, the above examples need to be trimmed without the forum/ part.

    ie.

    RewriteRule ^forum/faq

    should actually be

    RewriteRule ^faq

    Only leave the forum/ part in there if you are using the .htaccess in the parent (webroot) folder.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.