forward domains to a differenet ip address and different port?

b0072k1

Well-Known Member
Dec 30, 2004
132
0
166
Glasgow
Hi, Im just wondering how can i set up a subdomain set up on my server to connect to a remote computer to a certain port to allow people to connect to this port to access a certain system?

Any way this can be done at all?
 

hostmedic

Well-Known Member
Apr 30, 2003
543
0
166
Washington Court House, Ohio, United States
cPanel Access Level
DataCenter Provider
?cPanel dont think would support it - but here is a work around.

what are you trying to do exactly

take

www.domain.com/directory or http://subdomain.domain.com

and then forward that to www.anotherdomain.com:port#

the easiest way to do this is to create an index.php file under the domains default directory (or the sub domains default www directory and place the following into it -


Code:
<?php
header('HTTP/1.1 301 Moved Permanently');
header('Location: '.$url);

exit;
?>

in the above you would place http://anotherdomain.com:port# in place of the url -

ie http://1.1.1.1:2086 (yes you can even use ip addresses

via dns - not 100% sure that cPanel bind would support it...

Hope this helps.