Linode Forum
https://forum.linode.com/

How can I point a subdomain to a specific folder?
https://forum.linode.com/viewtopic.php?f=19&t=9354
Page 1 of 1

Author:  redhat19 [ Thu Sep 06, 2012 10:06 am ]
Post subject:  How can I point a subdomain to a specific folder?

Hi friends,

We have created an application to run on our server but which interfaces with a web application on another organization's server.
We got the the other organization to create a subdomain which point to our server's IP address.
(by the way, if you typed in our server's IP address, you''ll land on a default Apache/centOS page).

They pointed their subdomain to our server's IP address and now if a user goes to the subdomain, xyz.mydomain3.com, you'll be looking at our default Apache/CentOS page.

On our Linode server, the destination/where we have built the web application which the subdomain should be pointing to is mydomain2.com.

How can we point the subdomain, xyz (in xyz.mydomain3.com) to mydomain2.com?


Here's what our Linode DNS manager looks like:


Code:
DNS Manager ยป xyz.mydomain3.com
SOA Record
Primary DNS   Email   Default TTL   Refresh Rate   Retry Rate   Expire Time   Options
ns1.linode.com   myemail@gmail.com   Default   Default   Default   Default   Settings


NS Records
Name Server   Subdomain   TTL   Options
ns1.linode.com   xyz.mydomain3.com   Default   Edit | Remove
ns2.linode.com   xyz.mydomain3.com   Default   Edit | Remove
ns3.linode.com   xyz.mydomain3.com   Default   Edit | Remove
ns4.linode.com   xyz.mydomain3.com   Default   Edit | Remove
ns5.linode.com   xyz.mydomain3.com   Default   Edit | Remove
Add a new NS record


MX Records
Mail Server   Preference   Subdomain   TTL   Options
mail.xyz.mydomain3.com   10      Default   Edit | Remove

Add a new MX record


A/AAAA Records
Hostname   IP Address   TTL   Options
   123.45.68.90   Default   Edit | Remove

mail   123.45.68.90   Default   Edit | Remove

www   123.45.68.90   Default   Edit | Remove

Add a new A record


CNAME Records
Hostname   Aliases to   TTL   Options
Add a new CNAME record


TXT Records
Name   Value   TTL   Options
Add a new TXT record


SRV Records
Service   Domain   Priority   Weight   Port   Target   TTL   Options
Add a new SRV record

NOTE: Changes made to a master zone will take effect in our nameservers every quarter hour.


We would appreciate any helpful response.

Thanks.

Author:  hoopycat [ Thu Sep 06, 2012 11:23 am ]
Post subject:  Re: How can I point a subdomain to a specific folder?

In the Apache configuration section for mydomain2.com, you would add a line:

Code:
ServerAlias xyz.mydomain3.com


If you wished, you could instead use HTTP redirection (so that all requests for xyz.mydomain3.com get redirected to mydomain2.com) by setting up another VirtualHost just for xyz.mydomain3.com and using mod_rewrite.

Author:  redhat19 [ Mon Sep 10, 2012 12:14 am ]
Post subject:  Re: How can I point a subdomain to a specific folder?

Thanks @hoopycat.
Worked just fine.

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/