tibberous Posted February 2, 2008 Share Posted February 2, 2008 I want to have all the subdomains on my site point to a single PHP file. How do I do that? Quote Link to comment Share on other sites More sharing options...
toplay Posted February 2, 2008 Share Posted February 2, 2008 When posting try and be very clear and precise on what you mean so members on this forum can help you better. Where do you want it to point to a single php, in another subdomain, or main domain? Anyway, you could have the PHP files in your subdomains redirect to the PHP file you want. For easy PHP redirecting, do something like: header('Location: http://www.example.com/script_name.php'); exit; If you have Apache web server, look into perhaps using mod_rewrite. Good luck. Quote Link to comment Share on other sites More sharing options...
tibberous Posted February 2, 2008 Author Share Posted February 2, 2008 I'm trying to do something like redirecting all requests to XXX.mysite.com to www.mysite.com/index.php?subdomain=XXX , whenever XXX is not www, of course. And yeah - I'm using apache. Any idea how to do this? Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted February 2, 2008 Share Posted February 2, 2008 did u tried: header('Location: http://www.example.com/script_name.php'); exit; Quote Link to comment Share on other sites More sharing options...
mike177 Posted February 2, 2008 Share Posted February 2, 2008 Why don't you do what mmarif4u suggested. Just put a php file under each subdomain and have them redirect to mysite.com/index.php. Simple! <?php header("Location: http://www.mysite.com/index.php"); ?> Thats all you need. Quote Link to comment 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.