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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.