Greetings, I am having problems trying to figure out how to redirect a subdomain to a different website. Here's what I want to do: Redirect: forum.mydomain.com (hosted by me) -> forum.theirdomain.com (hosted by a different service) Everytime I setup/edit the 'Subdomain for website' and test it, forum.mydomain.com just directs to mydomain.com I'm hoping someone could help me set this up. Thanks
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.
You could also create a CNAME record for mydomain.com: Type: CNAME Name: forum Data: forum.theirdomain.com. Priority: 0 I think you can also use .htaccess file to do the redirect (not sure if this works): //Rewrite to forum Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} forum.mydomain.com[nc] RewriteRule (.*) http://forum.theirdomain.com/$1 [r=301,nc,l] But if you still want to do this by adding subdomain, I guess you could do it like this: Host: forum Domain: mydomain.com Redirect Type: L Redirect Path: /forumredir/ Now you can create forumredir folder to mydomain.com web directory and create index.php which contains header('Location: http://forum.theirdomain.com');
I've tried editting the CNAME to direct to the redirect site (xxx.proboards.com) but it still didn't work.