Howto link a subdomain to another server

LGoosens

Verified User
Joined
Jan 28, 2006
Messages
9
Location
Diemen, Holland
Hello,

I am the webmaster of a Star Trek website, www.warpcore.tk, and I am running a sci-fi forum with the webmaster of www.scifispace.net. He has a DirectAdmin control panel and the ability to create lots and lots of subdomains.

Our forum is hosted by a friend of mine, but he lost his domain name when trying to transfer it to another company (the stupid company kept the domain to sell it for big money :mad:), so our forum is domainless. It is now accessible through":

http://66.49.186.248/sites/warpcore/

This url isn't pretty. That's why we decided we would like to link a domain www.forum.scifispace.net to the forum.

I have tried using the DirectAdmin panel (the scifispace webmaster gave me access) to link a domain to 66.49.186.248 through DNS. This should work, but I can't seem to link it to that IP-address AND the directory /sites/warpcore/. How will I be able to do this?

Or does the friend hosting my forum need to set anything that will redirect traffic through forum.scifispace.net to the /sites/warpcore/ directory?

I really can't figure this out, so any help would be appreciated. :(

Lennart Goosens.
 
jlasman said:
How about an .htaccess file to create a permanent redirect for the subdomain to:

http://66.49.186.248/sites/warpcore/

Jeff
No, that's not what I want. I want a pretty url, not a sloppy redirect. I do not only want people to use www.forum.scifispace.net and get on the forum index, I ALSO want url's like this:

http://66.49.186.248/sites/warpcore/phpBB2/viewforum.php?f=26

to change into this:

http://www.forum.scifispace.net/phpBB2/viewforum.php?f=26

So if someone links to a topic directly it will also look good. ;)

I want exactly what I explained above...
So, how do I achieve that? :(

Lennart Goosens.
 
I didn't notice the another server when I suggested a site alias.

You can't easily do what you want to do. In fact, I can't figure out how you can do it at all, without creating some kind of alias system on the other service, in the httpd.conf file (or in the control panel, if the other server's control panel allows it).

Jeff
 
jlasman said:
I didn't notice the another server when I suggested a site alias.

You can't easily do what you want to do. In fact, I can't figure out how you can do it at all, without creating some kind of alias system on the other service, in the httpd.conf file (or in the control panel, if the other server's control panel allows it).

Jeff
Tell me more about how to do it using httpd.conf ... ;) If that allows me to do what I want, i'm happy.

Oh and by the way the OTHER server uses the Ensim Pro control panel i'm told.
 
I have no idea how to do anything in Ensim that won't confuse the control panel.

:(

Jeff
 
Just so I understand correctly:

You (Lennart) have a server running DirectAdmin. On this server you have created a user account which uses the domain name scifispace.net.

Your friend has a server with the IP address 66.49.186.248 (running ensim). This server does not have a domain name. It is running the forum in /sites/warpcore.

Idea:

Add an A record to the DNS zone of scifispace.net on the DirectAdmin server. This A record would define 'forum' as a subdomain of scifispace.net (e.g. forum.scifispace.net) and have it point to the IP address of the ensim server. Now if someone types forum.scifispace.net in their browser it would resolve to 66.49.186.248, right?

So now all that is needed is that the webserver running on the ensim server must be told to serve the forum webpages based on the forum.scifispace.net domain name.

I don't know ensim but assuming it has the same functionality as DirectAdmin, how about you create a user on the ensim server and let it use the same domain name: scifispace.net. Of course the registrar where scifispace.net is registered doesn't have the IP address point to the ensim server but that doesn't matter. It will cause the webserver on the ensim server to listen to requests for that domain name. Also create a subdomain 'forum' for scifispace.net on the ensim server and assuming it's running apache, modify httpd.conf so that the virtual host section will cause the 'forum' subdomain name to serve the forum webpages.

I'm not an expert on this and I haven't tried this myself, but at the moment I don't see why this wouldn't work...
 
Maybe this sounds strange but why dont u backup the forum database and install a new forum in the sub (forum.scifispace.net) and load the old db ( dont forget the custom theme's and stuff )

and ur forum should be oke and running on forum.scifispace.net .
 
Last edited:
Sorry, I am very sorry I neglected to tell you a year ago that the problem has been solved...:eek: Thanks anyway, your help was very valuable.

Just so you know...;)
 
Sorry, I am very sorry I neglected to tell you a year ago that the problem has been solved...:eek: Thanks anyway, your help was very valuable.

Just so you know...;)


can you tell us how the problem was solved !! as i am facing same problem :confused:
 
Solution

Hi there,

I'll tell you exactly how we achieved it.

It should be noted that this solution was created for DirectAdmin on the server that redirects, and for Apache on the server it redirects to. It will most probably not work on "target servers" other than Apache, for it uses a .htaccess file.

Goal: Make a "source server" point to a "target server".

Source server: hosts the domain and has the DNS features
Target server: hosts the web site we want to tie the domain to

  1. Login
    First of all, login to your DirectAdmin control panel.
    _
  2. DNS Menu
    Then, click "DNS Menu".
    _
  3. Create records
    There, you will see a list of all the subdomains and their DNS settings (see graphic below). You need to create a new A record, with the name of the subdomain you want to create, pointing to the IP-address of the "target server". Please note that it is possible that your web host has disabled this feature, in which case you will need to contact them.

    In my case, I wanted to create the domain www.forum.scifispace.net and have it point to 66.XXX.186.XX (digits are masked for obvious reasons). The graphic shows how to do this.

    It is important to create both "forum" and "www.forum" to ensure that both "http://www.forum.scifispace.net/" and "http://forum.scifispace.net" will work. I have seen some web sites for which one of those wouldn't work, and it is very annoying.

    Please note that it can take up to 72 hours for this domain you create to work on every and all connections in the world, for your DNS data needs to be distributed over a vast network of DNS servers around the globe.
    _
  4. .htaccess
    Now, if your visitors type "www.forum.scifispace.net" they will see the main page of the "target server". You need to tell the "target server" were EXACTLY you want your users to go. This is to be done through a .htaccess file, that tells the Apache server how to configure itself.

    To achieve this, create a new file called ".htaccess" (this is an extension only, and should not have another extension) using your favourite text-editor. Windows Notepad will suffice. This new ASCII text file needs to hold the following:

    Code:
    RewriteEngine On
    Options +FollowSymlinks
    RewriteBase /
    RewriteCond %{HTTP_HOST} forum.scifispace.net
    RewriteCond %{REQUEST_URI} !sites/forumdir/
    RewriteRule ^(.*)$ sites/dorumdir/$1 [L]

    Where forum.scifispace.net is the domain you created, and both instances of sites/forumdir/ refer to the directory you want to direct the traffic to.
    _
  5. Uploading the .htaccess file
    You need to place the .htaccess file in your root directory: the directory where the domain you created in the DirectAdmin control panel actually point to. In my case this was (the entire path up from the Linux root):

    /var/www/html/sites/

    This can however be something entirely different. In your FTP client, it should usually be the uppermost directory - the root - however, often designated "/".
    I'm just using a crappy FTP account that, accidentally, gave me access to the entire hard drive of the entire server... Including the files of the operating system. ;) But that is a rare situation.

To see how beautifully this works, just visit www.forum.scifispace.net !

Be aware that certain applications, like the forum software (phpBB 2) I use only work with one of two domains forum.scifispace.net and www.forum.scifispace.net, which is the one you configured in your admin panel. This is because the cookies are tied to a one domain and not to the other, which results in the user being "logged in... or not?" and the "read/unread" status of topics is lost. I'm currently working on a script that will fix this, but I have not been able to test it yet due to some web hosting issues.

Click here for the graphic of the DNS Control Panel

I hope to have helped you out. If any issues arise, feel free to contact me.

Cheers,
Lennart Goosens.
 
It will most probably not work on "target servers" other than Apache, for it uses a .htaccess file.
Are there any webservers that don't use .htaccess files? I belive they're part of the html spec.

Jeff
 
Back
Top