Log in

View Full Version : Redirection



Lumpy500
03-29-2009, 03:46 PM
Well.
Im running part of a gaming fansite, and on this game there are values for pieces of furniture etc.

Well on the site theres 2 links to the values on it
one is /rarevalues and the other is an actual domain on the same server

i need the /rarevalues directory to re-direct to the actual domain but as theyre running through the same directory i can figure a way of doing it. theres probably some simple way.

i thought

<?
if(isset($_GET['rarevalues']));
redirect code here;
?>

might do it but then i thought it only checks if theres ?rarevalues and not /rarevalues.
and i couldnt find a good re-direct code.

Help please.

Master_script_maker
03-29-2009, 03:48 PM
Maybe try htaccess redirection: Google (http://www.google.com/search?rlz=1C1CHMB_enUS305US305&sourceid=chrome&ie=UTF-8&q=htaccess+redirect)

techietim
03-29-2009, 04:34 PM
So you're looking for a .htaccess redirect?


RewriteEngine on
RewriteRule ^rarevalues http://example.com/ [R,L]

the moose
03-29-2009, 09:49 PM
I think what you are looking for is:



$pagetogoto = "index.php";
header ("Location: ".$pagetogoto);


This will redirect the page immediately when the PHP script reaches it.

Just make sure that the script has not output anything to the page yet as nothing can be sent to te browser before this is done.

Cheers

The Moose