mo Posted January 15, 2009 Share Posted January 15, 2009 My site has various sub domains, i.e. 123.mysite.com and when a user request 123.mysite.com I want them to always be redirected to 123.mysite.com/store.php. I know this should be simple to accomplish but not sure of the best method. Link to comment https://forums.phpfreaks.com/topic/140932-redirect-for-sub-domain/ Share on other sites More sharing options...
RussellReal Posted January 15, 2009 Share Posted January 15, 2009 subdomain or not your webserver will try to provide a landing page for the client: index.html, default.html depending on how you set up apache/whatever server you use.. that being said you can ASSUME that 123.whatever.com will automatically land on 123.whatever.com/index.php inside index.php put this: <? header("location: store.php"); ?> Link to comment https://forums.phpfreaks.com/topic/140932-redirect-for-sub-domain/#findComment-737628 Share on other sites More sharing options...
mo Posted January 15, 2009 Author Share Posted January 15, 2009 Perfect. I knew it was really simple and I feel stupid that I did not realize how to get this working. It is now working. Thanks. Link to comment https://forums.phpfreaks.com/topic/140932-redirect-for-sub-domain/#findComment-737631 Share on other sites More sharing options...
RussellReal Posted January 15, 2009 Share Posted January 15, 2009 there is other methods you can use such as .htaccess but this is probably the most simple Link to comment https://forums.phpfreaks.com/topic/140932-redirect-for-sub-domain/#findComment-737634 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.