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:

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.

2 Replies

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

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.

Thanks @hoopycat.

Worked just fine.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct