View Single Post
  #4  
Old 25th March 2013, 10:14
Jepso Jepso is offline
Junior Member
 
Join Date: Feb 2011
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is how I did something similar:

Instead of adding subdomain I added A-record to DNS.
When users tries to access forum.mydomain.com DNS points to specific IP where redirects are handled. Behind this IP there is a index.php where I read what site was requested and check from "redirects_db_table" if there is a row for this site. If row for this site was found, I have two ways for redirecting; URL and URL Frame -redirect. Desired method is stored in the same db row. If predefined method is URL, browser will be redirected to forum.theirdomain.com with header('Location: '.$result["target"]);. With URL Frame an iframe is created and target site or url is loaded into it like this: <iframe src="<?= $result["target"]; ?>"></iframe>. In both cases $result["target"] is the forum.theirdomain.com.
Reply With Quote