View Full Version : php and subdomain how?

10-28-2003, 02:26 PM

i hear that even if the subdomain are not allowed to make on some domain ..like sms.somedomain.com now when what i think is that when some page is not found on somedoamin it searches for 404 error page...which can b customized.. what if that 404 error page is customized in such a way that.. it picks up/records the subdomain that was requested and then redirects the visitor according to subdomain searched for..

like.. www.loop.com is the main domain

sms.loop.com is the search domain searched for which actaully doesnt exist..

404 page records /captures the request and then redirects the user to URl like www.loop.com/fix/sms/index.php

can it b done?

10-28-2003, 08:51 PM
depending on how your DNS is set up your request may never make it to your 404 error page , eg it will most likely go straight to your main domain index page ...

you can (either in your 404 or your index page) check the requested hostname ..


if( strstr( $_SERVER['HTTP_HOST '] , 'yaks.mydomain.com' ) ){