Hello from Costa Rica
I know you know a lot in PHP
Maybe you can help me ...
I have a hosting where i had pointed 3 domains names
Domain1
Domain2
Domain3
Also create 3 folders :
Site1/index.html
Site2/index.html
Site3/index.html
I need to do the following :
if someone types www.domain1.com or domain1.com ( without the www ) has to go to /site1/index.html
if someone types www.domain2.com or domain2.com ( without the www )has to go to /site2/index.html
if someone types www.domain3.com or domain3.com ( without the www )has to go to /site3/index.html
I made a index.php that can redirect with the www´s but if someone types the url without it it will go the third site
Any ideas
This is the Script I got :
<?php
$url = $_SERVER['HTTP_HOST'];
if($url=="www.domain1.com") {
$redirect_url="/site1/index.html";
} else {
$urls = $_SERVER['HTTP_HOST'];
if($urls=="www.domain2.com") {
$redirect_url="/site2/index.html";
} else {
$redirect_url="/site3/index.html";
}
header("Location: $redirect_url"); // Redirect browser
exit; // Make sure that code below does
// not get executed when we redirect.
$redirect_url="/site3/index.html";
}
header("Location: $redirect_url"); // Redirect browser
exit; // Make sure that code below does
// not get executed when we redirect.
?>