Welcome to WebmasterWorld Guest from 3.80.60.248

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

Forum 301's with .htaccess

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

Full Member

10+ Year Member

joined:Apr 9, 2003
posts:336
votes: 0


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?

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

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


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.

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

Full Member

10+ Year Member

joined:Apr 9, 2003
posts:336
votes: 0


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.

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

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


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?

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

Full Member

10+ Year Member

joined:Apr 9, 2003
posts:336
votes: 0


I want them all directed to just /forums/.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members