Jump to content

redirect script


jpratt

Recommended Posts

I am new to doing redirects and found a script to try, it looks like this:

[code]<?
$remote = getenv("HTTP_HOST");
$fp = fopen("redirect.txt", "r"); 

while (!feof($fp)):
$line = fgets($fp,1800); 
$line_list = explode("|",$line); 

$url1 = $line_list[0];
$url2 = $line_list[1];
$redirect = $line_list[2];

if ($url1 == $remote or $url2 == $remote):
Header("Location:$redirect");
$closefp = fclose($fp); 
endif;
endwhile;
$closefp = fclose($fp); 
?> [/code]

Also the text file:

alaskanflyrod.com|www.alaskanflyrod.com|akrod/index.php

and the header in the main account index page pointing to the redirect.php page:

<? require("redirect.php");?>

any ideas why this is not working? Thanks for the help.
Link to comment
https://forums.phpfreaks.com/topic/15268-redirect-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.