This will be a long introductory in an attempt to cover as much as possible out the gates.
I will be launching an apllication online in the near future. I have Wildcard DNS setup so users won't have to wait for hours or until the next day to use the application.
I use Linux, Apache 1.3.x, and php 4.3.10. I do NOT have root access as my current host is managed by my provider and is a cheap start up kind of a deal.
Ok, that aside here's what I am trying to do. Let's say I have domain.com registered and *.domain.com is the Wildcard DNS entry. When a user types in mysite.domain.com they will be sent to "http://domain.com" and the folder "mysite" is requested. If the folder exists they are forwarded to it's content. I already have a short script to do just that as follows.
<?php
// Retrieve requested domain name
$full_url = $_SERVER['HTTP_HOST'];
// Separate subdomain from requested URL
$subdomain = explode(".",$full_url);
// Set default redirect page if no subdomain is called
$default = ("main.php");
// If directory exists in document root with the name of "$subdomain"
// redirect to hostname/folder. Otherwise redirect to deafult page
if (is_dir("$DOCUMENT_ROOT/$subdomain/")){
header("Location:http://$full_url/$subdomain/");
} else {
header("Location:http//$full_url/$default");
}
?>
As you can see the current implementation forwards the user to "http://domain.com/mysite/"
What I would like is for all content in that folder to show up as the requested URL.... with subfolders of course like http://mysite.domain.com/folder/file.htm"
Thanks for any help I don't know where to go from here