As I readed in this forum, a lot of people has (or had) some problems when using www in their site name.
In fact there was an issue when going to
www.site.com and trying to login.
But I found another problem with www; maybe this wasn't hard to fix, but I would like to post my solution.
This is the situation: the login works for both sites, so you can login from site.com and
www.site.com; in both cases after the login you are redirected to site.com (by the option in the cb configuration) and you can use the site as you wish.
But if while you are logged in you go to
www.site.com, you will not be logged in; if you return to site.com you will be logged in again.
So the problem is: the www site doesn't maintains the login status.
The main problem is in the usage of cookies. Your site is configured as site.com, so cookies are created for site.com. If you go to
www.site.com, joomla doesn't find correct cookies and so you will not be logged in.
The solution is to find a way to make the site believes you are on site.com even if you are on
www.site.com.
First I tried a solution that works for subdomains: write
php_value session.cookie_domain ".site.com"
in the htaccess file of subdomains folders and the session of xxx.site.com will be shared with
www.site.com.
Doesn't work for me, but you can try.
In this case if your php is loaded as cgi you must write the line in the php.ini of your domain (usually there is a local version of php.ini).
Then I tried to modify manually the cblogin code, but I didn't find the place where cb retrieves the site name. I knew that I had to modify the use of the $_SERVER["HOST_NAME"], with $_SERVER["DOMAIN_NAME"].
So...doesn't work.
At last the solution:
in your htaccess file, even if php is not loaded as module, write:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.site.com$
RewriteRule ^(.*)$
site.com/$1
This will redirect you to site.com everytime you try to access
www.site.com.
So this solution should work for every issue related to www.
Hope this will help.
EDITED TITLE FOR SOLVED AND JOOMLA VERSIONS.
Post edited by: beat, at: 2007/10/07 15:54
Post edited by: baccanasta, at: 2007/10/08 01:16