Fixed old links

Forum announcements are posted here. New cool features, scheduled backups and maintenance, you name it.
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Fixed old links

Postby Jorg » Wed Jan 04, 2006 1:26 pm

Hi Guys,

I added a php redirect script to the old wxWidgets forum location that will guide all old links to the new one;

Links like;

http://wxwidgets.solidsteel.nl/viewtopi ... 1f16d2c089

Won't end up in a 404 error, but present the new link now. I do know know how to parse the part behind the viewtopic.php?....... so when someone knows how I will adjust the script. It looks like this now;

Code: Select all

<?php

$url = "http://wxforum.shadonet.com";

header ("Location: $url");
?>


Which is the most PHP I ever written in my life ;-)
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

lowjoel
Moderator
Moderator
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Postby lowjoel » Thu Jan 05, 2006 1:19 am

Code: Select all

$_SERVER['QUERY_STRING'];
ima PHP guru 8) haha, nah, i just picked up experience from the last 1 year or so (ive coded blog systems CMSes photo galleries... even nearly a forum and a chat room, as well as a shoutbox :D)

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Postby Jorg » Thu Jan 05, 2006 8:26 am

So what is the complete php code plus begin / end tag that I have to use? That will also fix the old links in the forum. I could make a DB query for that but hey since I still own the domain name, this will do for a while.

- Jorgen
Forensic Software Engineer

Netherlands Forensic Insitute

http://english.forensischinstituut.nl/

-------------------------------------

Jorg's WasteBucket

http://www.xs4all.nl/~jorgb/wb

priyank_bolia
wxWorld Domination!
wxWorld Domination!
Posts: 1339
Joined: Wed Aug 03, 2005 8:10 am
Location: BANGALORE, INDIA
Contact:

Postby priyank_bolia » Thu Jan 05, 2006 12:10 pm

Code: Select all

<?php
   $newUrl = "http://wxforum.shadonet.com";
   $requestUrl = $HTTP_SERVER_VARS['REQUEST_URI'];
   header("Location: ".$newUrl.$requestUrl);
?>

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Postby Jorg » Thu Jan 05, 2006 12:14 pm

Thanks I will implement this when I get home.

- Jorgen
Forensic Software Engineer

Netherlands Forensic Insitute

http://english.forensischinstituut.nl/

-------------------------------------

Jorg's WasteBucket

http://www.xs4all.nl/~jorgb/wb

lowjoel
Moderator
Moderator
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Postby lowjoel » Sat Jan 07, 2006 7:04 am

HTTP_SERVER_VARS is deprecated, use $_SERVER.


Return to “Forum Announcements”

Who is online

Users browsing this forum: No registered users and 1 guest