Thread: 301 redirects?
View Single Post
  #3 (permalink)  
Old 06-09-04
madstock madstock is offline
25 chars.? Need more spac
 
Join Date: Aug 2003
Location: here
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
madstock is an unknown quantity at this point
Thanks Jason - that is what we are doing for the "main" directories - the problem was with redirecting variables as opposed to a static constant - e.g. if someone clicks on a link to

http://www.oldsite.com/olddirectory/search.php?q=WHATEVER&order=WHATEVER

they are automatically redirected to:

http://www.newsite.com/newsearch.php?q=WHATEVER&order=WHATEVER

If it helps, there are only a couple of these types of files, they are all php, so I suppose I could edit the existing PHP file - which would lead to a further question - "How would one go about making dynamic php redirects" -

e.g.

1) Create a file called "details.php", which takes the bit after q=

<?

$details=$q;

echo $site[$details]."";

?>

2) Call the output of details.php within the header of

<?
include ("details.php");
Header ("Location: http://www.site2.co.uk/search.php?q=$details"); ?>

The problems with this are threefold:

1. The Header function cannot be used, as a header has already been called

2. "fopen" would expect more than 1 variable, and

3. I haven't really got the foggiest about what I am doing

If there is a simple "write this page" function that can be used instead of Header , above I would probably be on my way...

Apologies for the rambling once again...
Reply With Quote