Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created subdomains for my main site.



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

share|improve this question

migrated from Jul 1 '10 at 3:22

This question came from our site for professional and enthusiast programmers.

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

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

<VirtualHost *:80>

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

share|improve this answer

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

share|improve this answer
@SLaks - it says Server not found error – pradeep Jun 30 '10 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 '10 at 17:31

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:


then restarting apache2.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.