Super User is a question and answer site for computer enthusiasts and power users. 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 transferred my website to a new server about 2 days ago. I changed my Domain's NSs... After that, Now, all of my subdomains are showing exactly what my main domain is showing! have a look:

Could you please help me?

share|improve this question

closed as off topic by Indrek, ChrisF, Dave, Joe Taylor, BBlake Oct 1 '12 at 12:40

Questions on Super User are expected to relate to computer software or computer hardware within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Did you enter entries for the subdomains on the name server? – HaydnWVN Sep 26 '12 at 7:30
What do you mean? (I don't have access to the server. I'm just a user with CPanel) – Hamid Sep 26 '12 at 7:46
See @RedGrittyBrick's answer below. Essentially unless you want to configure your webserver for sub-domains you would need DNS entries on the DNS Server for each. – HaydnWVN Sep 26 '12 at 9:12

When a webserver like Apache receives a HTTP request for a web-site domain that it isn't configured for, it will return the contents for the first website that is in it's configuration.

(or a 404 response if the part of the URL after the hostname doesn't exist in the default site)

So probably the webserver isn't correctly configured.

Configuring domains in DNS is a separate action from configuring sites (with domain-names) in a web-server. Details depend on your hosting service.



Here's an example DNS zone file   IN   A   IN   A

Your domain hosting provider will have a point and click GUI for you to add these records, you don't have to do it using a text editor. However exactly what the GUI tools look like, and how to use them, depend on exactly which domain hosting service you are using.

In the case of the problem you describe, these records are probably set up correctly, you want to host both and on the same server.


Here's an example configuration for Apache HTTPD

# Ensure that Apache listens on port 80
Listen 80

# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /www/example1

# Other directives here


<VirtualHost *:80>
DocumentRoot /www/example2

# Other directives here


If the second <VirtualHost> clause (for was omitted, Apache would serve up the page for if you asked it for (actually it's been a while since I tested this but I expect it is still so).

Your hosting company's Control-Panel will have a point and click GUI that will cause the appropriate sections to be added to the HTTPD configuration file for you (you don't have to edit this textual configuration file using a text editor).

If your web-hosting company uses Nginx or IIS instead of Apache HTTPD, the config file may look completely different. The design and operation of the configuration GUI depends on your exact hosting provider, there are too many variations to cover them all here.

I believe is hosted by who use Apache HTTPD and cPanel, If you google for "How to add a site to a cPanel hosting plan" you should find some useful videos and other tutorial material. Good luck.

share|improve this answer
Thanks, but how can they solve the problem? I mean what should they do? I want to send them this page to study and maybe solve the problem. (I'm guessing they don't know how to solve the problem!) – Hamid Sep 26 '12 at 9:51
@Hamid: See updates. As I originally said, what you do depends on exactly which control-panel and httpd software your hosting service uses. They vary a lot, I can't cover all of them. – RedGrittyBrick Sep 26 '12 at 10:01

Finally the problem was discovered!! You may not believe but it seems that it is a bug in CPanel, when you transfer a website to a new server, sometimes all subdomains are added as a Parked Domain!!!! You have to go to Parked domain and remove all of them and if it is needed you should remove all subdomains and create them again!!

I just remembered when we transferred our website about 7 years ago, I faced to this problem but I couldn't understand how our hosting solved the problem! but now they told me the problem...

Anyway, I hope this topic would be useful for future and I hope CPanel team review their codes and cover the bug!

Thanks for your help ;)

share|improve this answer

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