extrovertive Posted September 28, 2009 Share Posted September 28, 2009 I have a website where if a user is logged in using http://www, then they won't be logged in when accessing http:// So, how can I use .htaccess so that if someone access http://domain.com/test it will become http://www.domain.com/test Link to comment https://forums.phpfreaks.com/topic/175837-making-sure-http-goes-to-httpwww-each-time/ Share on other sites More sharing options...
extrovertive Posted September 29, 2009 Author Share Posted September 29, 2009 Anyone? Link to comment https://forums.phpfreaks.com/topic/175837-making-sure-http-goes-to-httpwww-each-time/#findComment-927305 Share on other sites More sharing options...
khr2003 Posted September 30, 2009 Share Posted September 30, 2009 I am not sure about the htaccess file, but I think you can redirect your visitors by using regexp to check whether there is a www in the url or not Link to comment https://forums.phpfreaks.com/topic/175837-making-sure-http-goes-to-httpwww-each-time/#findComment-927533 Share on other sites More sharing options...
trq Posted September 30, 2009 Share Posted September 30, 2009 RewriteEngine on RewriteCond %{HTTP_HOST} !^www.domain.com$ RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301] Link to comment https://forums.phpfreaks.com/topic/175837-making-sure-http-goes-to-httpwww-each-time/#findComment-927542 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.