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 Quote 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? Quote 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 Quote 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] Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.