0

I have created subdomains for my main site.

like

  • cdn1.abc.com
  • cdn2.abc.com
  • cdn3.abc.com

and all point to / . but when I try to use cdn1.abc.com in a url it does not work. Perchance there is something else I need to do?

3
  • What are you using to manage your subdomains?
    – William
    Jun 30, 2010 at 17:16
  • 3
    and which web server? Jun 30, 2010 at 17:18
  • @Eric Petroelje - apache server and godaddy account
    – pradeep
    Jun 30, 2010 at 17:23

3 Answers 3

3

With your virtual host settings, you need to add a ServerAlias, sort of like this:

<VirtualHost *:80>
        ServerName abc.com
        ServerAlias cdn1.abc.com cdn2.abc.com cdn3.abc.com

You could also do "*.abc.com" on that line instead, if you wanted to allow all subdomains.

1

You need to setup Apache to serve your files for all of the subdomains.

2
  • @SLaks - it says Server not found error
    – pradeep
    Jun 30, 2010 at 17:30
  • @SLaks - godaddy provides a interface to create subdomains. then also i need to do apache configuration.. can u just show me the apache code for it?
    – pradeep
    Jun 30, 2010 at 17:31
0

There are two parts to this:

  • You must create the DNS records so that those new names resolve to the IP address of your server. That will allow people to get sent to the correct location.
  • The second part is configuring Apache to recognize these new hostnames and serve the right content.

The first part will probably involve you using some online control-panel at your domain registrar. The second part will probably be as simple as adding:

 ...
 ServerName abc.com
 ServerAlias     cdn1.abc.com cdn2.abc.com cdn3.abc.com

then restarting apache2.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .