...

View Full Version : [SOLVED] Session problem with "http://www."



cast_no_shadow
10-29-2012, 01:54 PM
Hello,

The php session in my web is not working when I use the address "http://www.myweb.com".

When I use "http://myweb.com" everything is working.

This is quite annoying.

Is there a way of get rid of the "www." automatically? or maybe there is a way to make the php session work in both "http://www.myweb.com" and "http://myweb.com"?

Thanks a lot!

abduraooft
10-29-2012, 02:07 PM
Is there a way of get rid of the "www." automatically?
Yes, you may redirect all www request to a no-www equivalent, by adding the following lines in .htaccess file (assuming you are using an apache server) of website's root


RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

cast_no_shadow
10-29-2012, 02:23 PM
Yes, you may redirect all www request to a no-www equivalent, by adding the following lines in .htaccess file (assuming you are using an apache server) of website's root


RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

Thanks that solved my problem!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum