I'm using the session_start() function in PHP to initialize session data for all of the login stuff on my website. However I just noticed that if I go to my website using www.domain.com it doesn't care the session variables over if I just go to domain.com (without the www). It works both ways like that. Is that normal? Can anything be done about it?
Also, isn't there a way in htaccess to make my site automatically redirect from domain.com to www.domain.com?
Sure, try this : RewriteEngine on RewriteCond %{HTTP_HOST} ^yourdomain.com [NC] RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301] Code (markup):