1

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)

2

Re: How I fix my Log in and Log out Problem

hi,

in order to always set up www. I have made thus in the rows htaccess

<IfModule mod_rewrite.c>

RewriteEngine on

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

3

Re: How I fix my Log in and Log out Problem

I was having the same problem and this mod worked for me BUT...if my members are like me, sometimes they type in "www.example.com" and sometimes just "example.com". There surely is a way to have both options work. Isn't there?

4

Re: How I fix my Log in and Log out Problem

Where you have "example" in code line, am I supposed to enter MY URL?

5

Re: How I fix my Log in and Log out Problem

yes
replace example.com with your domain.ltd
for example: example.com becomes: myswebsite.org

6

Re: How I fix my Log in and Log out Problem

I could login to /cp before but now can not.. think i might have changed password and forgot it. any idea how to get it back

7

Re: How I fix my Log in and Log out Problem

So you can only decide to have the url with " www " or without  ??

So if you decide to go for the " www " , and if a member doesn't enter the www but only " example.com " than they will have the error ?

Is there a way to make it work for both ?

If there is, can anyone please tell me, This is really urgent !

PLEASE !

8

Re: How I fix my Log in and Log out Problem

Read the topic again, the code above automatically redirects the member to correct URL.

Developer

9

Re: How I fix my Log in and Log out Problem

What if I can't use  www?

I have an option to use site.moresite.com or 231.12.323.42 without www. And it's not accessible with www and there is no way to get www at all smile
Is there any way to fix login problem in this case?

Redirect won't help.

Thanks

Last edited by inatmo (2010-10-13 07:49:33)

10

Re: How I fix my Log in and Log out Problem

You shouldn't have any login issues in your case as long as you access your site through site.moresite.com

Developer