fooDigi Posted March 29, 2006 Share Posted March 29, 2006 with php, is there a way to test to see if certain subdomains exist?thx in advance Quote Link to comment https://forums.phpfreaks.com/topic/6132-sub-domains/ Share on other sites More sharing options...
Guest footballkid4 Posted March 30, 2006 Share Posted March 30, 2006 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... Quote Link to comment https://forums.phpfreaks.com/topic/6132-sub-domains/#findComment-22135 Share on other sites More sharing options...
fooDigi Posted March 30, 2006 Author Share Posted March 30, 2006 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 :()-=={{{ Quote Link to comment https://forums.phpfreaks.com/topic/6132-sub-domains/#findComment-22231 Share on other sites More sharing options...
txmedic03 Posted March 30, 2006 Share Posted March 30, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/6132-sub-domains/#findComment-22243 Share on other sites More sharing options...
trq Posted March 30, 2006 Share Posted March 30, 2006 What kind of server access do you have? Is it just a shared server? Quote Link to comment https://forums.phpfreaks.com/topic/6132-sub-domains/#findComment-22271 Share on other sites More sharing options...
Guest footballkid4 Posted March 30, 2006 Share Posted March 30, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/6132-sub-domains/#findComment-22299 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.