Hi all:
I am switching my site over from ASP classic to PHP. I am using my 404 asp page to redirect url shortcuts. Meaning, there is no page on my site called http://www.MySite.com/Shortcut but when this goes to my 404 asp page the following code redirects it:
clientID = mid(lcase(Replace((Request.Querystring),":80","")),5)
SELECT CASE clientID
CASE "http://www.MySite.com/Shortcut"
response.redirect "../shortcut.asp"
CASE ELSE
response.redirect "../msc/msc_errors.asp?Error=badpage&Trace="&Replace(Request.Servervariables("QUERY_STRING"),":80","")&""
I found this code on the web and it works great. I am trying to duplicate this for PHP without success.
$clientID = strpos(strtolower(str_replace(":80","",$_SERVER['QUERY_STRING'])),5);
switch ($clientID){
case "http://www.MySite.com/shortcut":
header('Location: ../shortcut.php');
break;
default:
header('Location: ../msc/mscErrors.php?error=badPage&trace='.str_replace(":80","",$_SERVER['QUERY_STRING']));
I am just getting "The page isn't redirecting properly" errors
Is there a better way to accomplish this?
Thank you!