01.05.2011, 16:56
I would like to redirect people to another page, if they are using the wrong URL to access my website.
E.G They visit "www.englishfreeroam.co.cc" and get redirected to "www.englishfreeroam.co.cc/EFR" and if they visit "linuxthefish.visualserver.org" they get redirected to "linuxthefish.visualserver.org/blog". I've tried to make something, but failed.
http://www.w3schools.com/php/php_if_else.asp - This could be used?
http://linuxthefish.visualserver.org/other/test.php - This shows it detecting the URL.
http://englishfreeroam.co.cc/other/test.php - This shows it detecting the URL.
I've NEVER used PHP like this before, so i'm only guessing...
E.G They visit "www.englishfreeroam.co.cc" and get redirected to "www.englishfreeroam.co.cc/EFR" and if they visit "linuxthefish.visualserver.org" they get redirected to "linuxthefish.visualserver.org/blog". I've tried to make something, but failed.
http://www.w3schools.com/php/php_if_else.asp - This could be used?
http://linuxthefish.visualserver.org/other/test.php - This shows it detecting the URL.
http://englishfreeroam.co.cc/other/test.php - This shows it detecting the URL.
PHP код:
<?php>
$domain = $_SERVER['HTTP_HOST'];
if ($domain=="www.englishfreeroam.co.cc")
//Redirect to site 1?
elseif ($domain=="linuxthefish.visualserver.org")
//redirect to site 2?
?>