Log in

View Full Version : Redirect for Defunct Forum ID Number?


jnr
10-29-2007, 08:52 PM
In the course of reorganizing my forums, I created some new forums, moved various threads to them, and deleted the old forums.

Problem is, I now realize that this of course killed the links to those forums that I had included in a press release that I had previously published.

I see from an old thread on vBulletin.com (http://www.vbulletin.com/forum/showthread.php?t=158449) that it would be unwise to try to re-number forums (even if I knew how).

Is there any way to redirect requests for the old forums to the new ones?

Thanks for any help.

fringehead
10-30-2007, 02:20 AM
You could try a redirect with .htaccess like this:

Redirect /olddirectory/oldfile.html http://yoursite.com/newdirectory/newfile.html

I have not used this with vb but edit the .htaccess file in your forum folder and see if it works. If you have problem just delete the entry (or the .htaccess file) but I think it will work.

Sean

jnr
10-30-2007, 09:14 PM
Thanks Sean, but it doesn't work. Redirect doesn't parse the question mark or what comes after.

With a assist from Jake Bunce of the vBulletin team, who suggested I use the RewriteEngine, I tracked down the solution. I modified the code I found at http://www.webmasterworld.com/forum92/1917.htm. Here's an example of how to do it:

To redirect defunct link
http://www.greenmachines.net/forumdisplay.php?f=16

to
http://www.greenmachines.net/forumdisplay.php?f=31

put this in your .htaccess file:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{QUERY_STRING} ^f=16$
RewriteRule ^forumdisplay\.php$ http://www.greenmachines.net/forumdisplay.php?f=31 [R=301,L]

You could try a redirect with .htaccess like this:

Redirect /olddirectory/oldfile.html http://yoursite.com/newdirectory/newfile.html

I have not used this with vb but edit the .htaccess file in your forum folder and see if it works. If you have problem just delete the entry (or the .htaccess file) but I think it will work.

Sean

fringehead
10-30-2007, 11:50 PM
There is a lot you can do with .htaccess. I'm glad you figured it out. Find what to use is 98% of the battle! If I ever need to do what you did, it's now documented! Thanks for sharing what worked!

Sean