And it seemed to almost be working, except for the fact that I was getting a PHP error on line 1 of my script. What do you guys think?
Parse error: syntax error, unexpected T_STRING in /home/content/html/main.html on line 1
<?php
#####################################################################
# YOU MUST EDIT THE FOLLOWING VARIABLES:
#####################################################################
# Your domain name WITHOUT the "www." NO TRAILING SLASHES ("/")
# Just the actual domain name: "yourdomain.com"
$domain = "domain.com";
# The relative path to your users sites directory, ex:
# if your users directory is installed in yourdomain.com/sites you
# should enter only $userdir = "sites";
$userdir = "sites";
# The default page that the visitors should be redirected to if
# they don't request a subdomain or they request a non-existing
# subdomain. This page should be your main index page. You can
# simply rename your existing index.html file to main.html This
# index.php file must be the default file that users are first
# directed on your site, so you must remove any other index.html or
# index.xxx file that may conflict. The main.html page should be
# located in your document root:"http://yourdomain.com/main.html"
$default_page = "main.html";
# Do you want to use frames?
$use_frames = "yes";
#####################################################################
# CONFIGURATION COMPLETE... DO NOT EDIT ANYTHING BELOW HERE
#####################################################################
$sub = $_SERVER['HTTP_HOST'];
$sub = eregi_replace("\.".$domain, "", $sub);
$sub = eregi_replace("www\.", "", $sub);
$sub = strtolower($sub);
$docroot = $_SERVER['DOCUMENT_ROOT'];
if (is_dir("$docroot/$userdir/$sub")) {
if ($use_frames == "yes") {
echo "<html><head><title>$sub</title>\n";
echo "</head>\n";
echo "<frameset cols=100%,* frameborder=no border=0 framespacing=0>\n";
echo "<frame src=http://$domain/$userdir/$sub>\n";
echo "<noframes>\n";
echo "<body bgcolor=#FFFFFF>\n";
echo "<br><br><font face=verdana size=2><center>\n";
echo "This page uses frames, but it seems that your browser does not support this feature.\n";
echo "<br><br>To move on, click here: <a href=http://$domain/$userdir/$sub>$sub.$domain</a>\n";
echo "</center></font>\n";
echo "</body>\n";
echo "</noframes>\n";
echo "</frameset></html>\n";
exit;
}
else {
header("Location: http://$domain/$userdir/$sub");
exit;
}
}
else {
include "main.html";
}
?>