Forum Moderators: phranque

Message Too Old, No Replies

Forum 301's with .htaccess

         

TimmyMagic

11:13 am on Feb 23, 2009 (gmt 0)

10+ Year Member



I have moved a phpBB forum to vBulletin, and am having trouble with 301 redirects. I have managed to do the basic redirect as follows:

Redirect 301 /forum/viewforum.php [mysite.com...]

However the problem comes when a URL indexed in Google such as:

/forum/viewtopic.php?t=3428&sid=4f3271ab23efb94

This just gives an error page. I have looked around WW, searched, and looked in the guidelines. I know there is something missing but I'm unsure of what it might be. Is it just a simple * or $ symbol I need to include?

g1smd

11:37 am on Feb 23, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You need to strip the session ID.

Do you need the old forum URLs to redirect to the root of the new forum, or do you need to redirect each thread to the new thread URL for that thread? (The latter is more work, but much better in the long run).

You'll likely need to use RewriteRule with [R=301,L] instead of Redirect.

TimmyMagic

11:50 am on Feb 23, 2009 (gmt 0)

10+ Year Member



The new forum is on the same domain and is under /forums/ so I just want them all redirected to there.

I already have a rewrite rule at the top of my .htaccess:

RewriteEngine On
rewritecond %{http_host} ^mysite.com
rewriteRule ^(.*) [mysite.com...] [R=301,L]

This is for the wwww rewrite. This is why I was thinking maybe I'm missing a * or $ sign for the forum redirects.

g1smd

12:29 pm on Feb 23, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That code redirects non-www to www and nothing more. However, be aware that you should write it using RewriteRule (note casing) and HTTP_HOST (note casing) etc.

I understand that the new forum is on the same domain, and in a folder, but my question was whether you want to redirect all the old URLs for every thread to one single new URL, or whether you want each old thread to redirect to the new URL for that thread?

TimmyMagic

1:23 pm on Feb 23, 2009 (gmt 0)

10+ Year Member



I want them all directed to just /forums/.