[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Subdomain Problem

Posted on 2011-02-17
14
Medium Priority
?
276 Views
Last Modified: 2012-05-11
Hello,

I had problem with my one of domain.  
Say for eg  domain is www.abc.com. And i had created 4 new subdomain for this.
Now when i try to open this 4 domain, its working fine. But when i try to open subdomain which is not created, then its opening the main domain .  i m not getting 404 msg.

How can i restrict this via htaccess or anything. ?

0
Comment
Question by:david_php
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
  • 2
  • +1
14 Comments
 
LVL 6

Expert Comment

by:richardburwood
ID: 34914551
From the symptoms you are describing your dns is setup to reslove non existant sub domains to the main ip address. You need to either change the setup of the dns so that it does not resolve non existant sub domains or counfigure you web server to inspect the host headder for the requests and respond accordingly. If you use the first option I would expect you to get a browser error saying the website was not reachable if you use the second option I would expect you to see a 400 error (not 404 page not found error)
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 34914597
Also remember that you will need to set up separate records in Apache's virtualhosts for each subdomain so that when the DNS routes traffic to the server then Apache routes that traffic to the correct subdomain.
0
 

Author Comment

by:david_php
ID: 34914661
Right now for every subdomain , there are two A records
au      A      xxx.xxx.xxx.xxx
www.au      A      xxx.xxx.xxx.xxx

For main domain also there is two A records.


How can i set the parameter to stop this
0
Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

 
LVL 6

Expert Comment

by:richardburwood
ID: 34914791
What DNS Server / Service are you using?
0
 

Author Comment

by:david_php
ID: 34914800
i m using DIRECT ADMIN  
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 34914881
If you ping or dig the subdomains what IP is returned?
0
 

Author Comment

by:david_php
ID: 34915070
its the main  ip
0
 
LVL 18

Expert Comment

by:Sudaraka Wijesinghe
ID: 34915270
You might have the wild-card sub-domain (*) pointed at your main domain (@) in your DNS settings.
0
 

Author Comment

by:david_php
ID: 34915289
yeah i had got the wildcard SSL.

Is it creating problem??
0
 
LVL 18

Expert Comment

by:Sudaraka Wijesinghe
ID: 34915339
well, if you have * entry in your DNS zone that means your are accepting any sub-domain at the DNS resolution stage. SSL doesn't play any role here, however if your wild-card SSL forces you to have the * entry in DNS, you can handle them in your web server configuration.
0
 

Author Comment

by:david_php
ID: 34915367
in dns mangagement  there is no such entry for * ..
0
 
LVL 6

Accepted Solution

by:
richardburwood earned 2000 total points
ID: 34925367
Can you do an nslookup on the following and post the results:

Your primary domain: e.g. www.abc.com
A sub-domain that exists: e.g. sub.abc.com
A sub-domain that does not exist: e.g. xxx.abc.com

Regards
0
 

Author Comment

by:david_php
ID: 35696284
Dear Moderator,

I want to ask a new question but i'm not able to do it, your system saying my this question will be closed on 9th May, 2011. and then I can add new question.

Please let me know how can I add new question right now, its very important.

Thanks,
Raj
0
 

Author Closing Comment

by:david_php
ID: 36501114
done
0

Featured Post

Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question