Jump to content


Photo

sub domains


  • Please log in to reply
5 replies to this topic

#1 fooDigi

fooDigi
  • Members
  • PipPipPip
  • Advanced Member
  • 250 posts
  • LocationDuluth, Mn

Posted 29 March 2006 - 10:47 PM

with php, is there a way to test to see if certain subdomains exist?

thx in advance
All your base are belong to us.

#2 Guest_footballkid4_*

Guest_footballkid4_*
  • Guests

Posted 30 March 2006 - 12:18 AM

It depends on the way the server is setup. If the subdomain doesn't exist, some servers will just redirect you to the main server...meaning that if you ping it, you will still get a response. Other hosts won't give a response, so you can ping it and tell like that...

#3 fooDigi

fooDigi
  • Members
  • PipPipPip
  • Advanced Member
  • 250 posts
  • LocationDuluth, Mn

Posted 30 March 2006 - 08:13 AM

thanks footballkid, i understand, that there is no definitive way of doing this. the server(s) that i work on are unique and require that same unique attention....

but, tending to my nature, i must believe someone has some suggestions or ideas to help me. this is something i must do. and to try and get some elaboration on your comment on unique server setup, surely someone has ideas.

*edit - ahhhhhj, i think im gonna output :()-=={{{
All your base are belong to us.

#4 txmedic03

txmedic03
  • Members
  • PipPipPip
  • Advanced Member
  • 313 posts
  • LocationCall, TX, USA

Posted 30 March 2006 - 10:01 AM

Well, it depends greatly on your server and what kind of features they disable/enable and how they configure sub-domains. If the sub-domains are simply directed to folders under the root directory then you can simply check to see if under the root directory if (is_dir($subdomain)) echo "Sub-domain exists!"; or if (!is_dir($subdomain)) echo "Sub-domain not found!"; depending on how you want it setup. There are a number of ways the server may be configured, but this is just one possible solution.

If they use a 404 error when trying a sub-domain that doesn't exist you may consider checking to see if it returns a 404 error or not.

SEMPER FIDELIS!

I can't stop you from doing something silly, but at least I can help you do it right.


#5 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 30 March 2006 - 01:00 PM

What kind of server access do you have? Is it just a shared server?

#6 Guest_footballkid4_*

Guest_footballkid4_*
  • Guests

Posted 30 March 2006 - 02:26 PM

Yes, I guess you couldl simple check if the folders exist...but what happens when/if he's not checking his site? Then he doesn't have access to the folders.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users