Jump to content

Archived

This topic is now archived and is closed to further replies.

fooDigi

sub domains

Recommended Posts

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

thx in advance

Share this post


Link to post
Share on other sites
Guest footballkid4
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...

Share this post


Link to post
Share on other sites
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 :()-=={{{

Share this post


Link to post
Share on other sites
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 [b] if (is_dir($subdomain)) echo "Sub-domain exists!"; [/b] or [b] if (!is_dir($subdomain)) echo "Sub-domain not found!"; [/b] 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.

Share this post


Link to post
Share on other sites
What kind of server access do you have? Is it just a shared server?

Share this post


Link to post
Share on other sites
Guest footballkid4
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.