jpratt Posted July 21, 2006 Share Posted July 21, 2006 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.phpand 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. Quote Link to comment Share on other sites More sharing options...
king arthur Posted July 21, 2006 Share Posted July 21, 2006 Unless your site's hostname is alaskanflyrod.com the script will not execute the header() function and the browser will not be redirected. Quote Link to comment Share on other sites More sharing options...
jpratt Posted July 21, 2006 Author Share Posted July 21, 2006 my host is arcticsoft.net, how should it look then? Quote Link to comment Share on other sites More sharing options...
king arthur Posted July 21, 2006 Share Posted July 21, 2006 For that you would need to say what it is you're trying to do. Quote Link to comment Share on other sites More sharing options...
jpratt Posted July 24, 2006 Author Share Posted July 24, 2006 If the user types arcticsoft.net they get the main account page under htdocs, if they type alaskanflyrod.com they are redirected to the akrod folder and that site opens up. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.