Log in

View Full Version : Changing forum URL's redirect script.


FleaBag
06-20-2002, 05:21 PM
This isn't a hack, so I thought best post it here. Basically, my forums are currently located at www.gamerforums.com/board, and I wish to change them so that they are at www.gamerforums.com - does anyone know of, or can anyone create a simple PHP script that will redirect people visitng board/forumdisplay.php and board/showthread.php to the correct posts and forums in root/forumdisplay.php and root/showthread.php. Thanks in advance! :)

Logician
06-21-2002, 10:23 AM
If you are on Apache Server you can do it via .htaccess file..

The structure is:

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

Check keyword "htaccess redirect" in either this board or in the internet I'm sure you'll find a lot of info :)

FleaBag
06-21-2002, 11:21 AM
I'd heard a little about that in the past, but I thought it wouldn't work for dynamic content, e.g. wouldn't I have to type out every one of my 40000 thread URL's in the .htaccess file?

Logician
06-21-2002, 01:37 PM
no of course not.. (otherwise would I suggest that?) ;)

You can redirect the whole directory to an other directory. Besides even if it's file redirection it works with dynamic content. That is, if you redirect showthread.php it redirects all calls to this file including dynamic ones like "showthread.php?yourcontent here".

BTW why dont you move your forum to your maindirectory? This can be wise solution. If you dont want your members to lose bookmarks, you can redirect that directory to your new URL.

FleaBag
07-03-2002, 10:04 PM
I can't find anything specific to my needs. :(

FleaBag
07-10-2002, 10:47 PM
You know of any examples Logician?

Logician
07-11-2002, 06:31 AM
I cant remember the source info but here is a nice document I keep handy. It covers all .htaccess subjects but I'm sure you can use it for your needs..

FleaBag
07-11-2002, 11:14 AM
Thanks dude. :)