Topic: How I fix my Log in and Log out Problem
I have three vldP license. Two of my sites were up and running using 2.5.3 with no login problems.
Today I decided to start working on my 3rd site, but logging in and staying logged in was a challenge.
SCENARIO:
1. I would try to login from the frot end but the screen would refresh and I was not logged in
2. I could login from the backend, www.mysite.com/cp, but if I clicked the link in the Control Panel to go to the front end, I will be logged out.
3. Even worse, things seem to be sporadic. I could login from the front end at times and at times I could not.
SOLUTION:
1. What I wasn't paying attention to was my address bar in my browser. My 3rd site had a mixture of URLs that either used the WWW or did not. For example, http://mysite.com v.s. http://www.mysite.com.
2. Next I looked at my 3rd sites config.php file and notice that all the site virtual URLs were listed without the www in the URL.
3. The solution was to make sure my config.php URLs were the same as my browser URL. I had to place coding in my htaccess file to either use WWW or not use it. I decided to go with WWW in URLs.
4. I added the following in vldP htaccess to force all my URLs to have www
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
If you are not sure where to put the above in vldP htaccess code I placed it right above the MEMBER ACCOUNT PAGES:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
################################################################
##################### MEMBER ACCOUNT PAGES #####################
################################################################5. Next I went into my config.php file and made sure all virtual URLs had www.
$conf['system_path'] = '/home/xxxxxx/public_html/filipinaeyes/vldp/';
$conf['virtual_path'] = 'http://www.filipinaeyes.com/vldp/';
$conf['virtual_cp_path'] = 'http://www.filipinaeyes.com/vldp/cp/';
$conf['system_tpl_path'] = '/home/xxxxxx/public_html/filipinaeyes/vldp/templates/';
$conf['virtual_tpl_path'] = 'http://www.filipinaeyes.com/vldp/templates/';
$conf['system_pic_path'] = '/home/xxxxxx/public_html/filipinaeyes/vldp/media/uploads/';
$conf['virtual_pic_path'] = 'http://www.filipinaeyes.com/vldp/media/uploads/';
Note: that the only URLs needing the www in the URL were all virtual URLs. I put xxxxxx in the above for security reasons.
That's it - I now had no log in problems.
Last edited by db3204 (2009-12-19 09:07:47)