leequalls Posted December 23, 2008 Share Posted December 23, 2008 is there a way to get the url in php say some one went to my site http://site.com is there a way I can say if url = http://site.com goto www.site.com thanks Link to comment https://forums.phpfreaks.com/topic/138125-quick-question/ Share on other sites More sharing options...
trq Posted December 23, 2008 Share Posted December 23, 2008 Better handled by the server but here ya go. if (strpos($_SERVER['SERVER_NAME'], 'www') === false) { header("Location: http://www.site.com"); } Link to comment https://forums.phpfreaks.com/topic/138125-quick-question/#findComment-722049 Share on other sites More sharing options...
leequalls Posted December 23, 2008 Author Share Posted December 23, 2008 thanks sessions wasn't working without the www.site.com for some reason Link to comment https://forums.phpfreaks.com/topic/138125-quick-question/#findComment-722056 Share on other sites More sharing options...
blueman378 Posted December 23, 2008 Share Posted December 23, 2008 yeah for that you need to set the session domain Link to comment https://forums.phpfreaks.com/topic/138125-quick-question/#findComment-722096 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.