Update: Now uses the new variable naming convention.
I noticed it was often asked if it was possible to have addresses such as forum.mydomain.com, mydomain.com, and my2nddomain.com all pointing to different sites on abyss.
Although you can't actually do this via abyss (yet), you can using this small php script I wrote. If you put it in the /htdocs of your directory, and name it index.php (or other .php index extension), depending on the url the user entered it will forward to a different website.
This code is setup for 3 websites, and if neither of the addresses are entered it shows an error page of your choice. Just duplicate where indicated! To have less than three domains, simply delete 1 block of the code (from 'if' to '}')
<?php
//get domain entered in browser
if ($_SERVER['HTTP_HOST'] == "forum.yourdomain.com") {
//forward to appropriate page
header("Location : forum/index.php");
exit;
}
if ($_SERVER['HTTP_HOST'] == "yourdomain.com") {
header("Location : mainpages/home.html");
exit;
}
//duplicate from here for more addresses
if ($_SERVER['HTTP_HOST'] == "yourdomain2.net") {
header("Location : website2/home.html");
exit;
}
//end duplicating, insert below.
//else show error page
else {
header("Location : error.html");
exit;
}
?><title>Opening Your Page ::</title>
Common Problems:
- Do not include http:// in the $_SERVER['HTTP_HOST'] == "whatever" field. Http:// is not part of the domain itself, and just tells the system to request the page using the web protocol.
- Ensure when copying you include all "s. If you do not, the script will fail.
- Any others? Let me know :)
Hope this is of use to some of you,
Neil