[SOLUTION J1.0.12-] www issue: login doesn't keep

11 years 9 months ago #56629 by akmuller
I too, am having a problem with this.

Joomla 1.0.13
PHP Version: 4.4.7
Web Server: Apache/1.3.37

Now, to be clear, my users are able to login. All they have to do is go to the correct style. As long as you are the site.com version and not the www.site.com then you are logged in. Even if you login with www., you can still access the site if you THEN switch to site.com.

So pretty much I've instructed them to click on the home link after they login. It's annoying though and I know not all of them are understanding that.
11 years 9 months ago #56636 by joshua.lyon
akmuller wrote:

I too, am having a problem with this.

Joomla 1.0.13
PHP Version: 4.4.7
Web Server: Apache/1.3.37

Now, to be clear, my users are able to login. All they have to do is go to the correct style. As long as you are the site.com version and not the www.site.com then you are logged in. Even if you login with www., you can still access the site if you THEN switch to site.com.

So pretty much I've instructed them to click on the home link after they login. It's annoying though and I know not all of them are understanding that.

That wasn't a really strong first post but we'll give you the benefit of the doubt. You didn't mention if you tried any of the suggestions posted in this thread. It's not like it's a really long thread so you don't have the excuse that you didn't feel like reading through the whole thing. Regardless, you can either try the code fix I recommended which is a dynamic fix that will work even if you change subdomains / redirect domains / etc. Or try someone else's code fix (which I haven't tested). And the other option is to do an htaccess redirect - which doesn't work on non-Apache boxes. I happen to be running Joomla and CB on my own box which is running IIS which is why I had to come up with the code fix. If you are with shared hosting, you are probably on Apache and if you are running a VPS or dedicated server you should know what web server software you are running. ;)

You should really have an 301 (htaccess) redirect to a single domain regardless of if you are having component issues or not. It's better for your search engine results and it's just better in general to standardize on a URL structure. I wrote an article about 301 redirection on my site:
http://boshdirect.com/blogs/tech/301-redirection-using-htaccess.html

--edit---
I should note that the section you should be interested in (in the article on my site) is called "Redirect www and other domains to proper domain"

Post edited by: joshua.lyon, at: 2008/02/13 04:23

---
Josh
11 years 9 months ago #56693 by akmuller
1) I'm doing most of this work on my lunch breaks, so I appreciate the 'benefit of the doubt.' I don't have a lot of time to work through much. I did however read through the whole post, which leads me to 2...

2) I noticed that there are plenty of people on here still having problems and the fixes aren't working. So the purpose of my post was more along the lines of adding to the people who are having problems with this feature so as to give more credence to the issue.

3) I tried both the .htaccess fix (which ended up making the site unavailable all together when using the www. maybe I'm doing it wrong....) and the $loginPost fix which seems to have done nothing at all.

I happen to be running Joomla and CB on my own box which is running IIS which is why I had to come up with the code fix. If you are with shared hosting, you are probably on Apache and if you are running a VPS or dedicated server you should know what web server software you are running.

4) As I mentioned in my original post, it's Apache.

Thanks for the followup Joshua. I have not yet had a chance to read your article as lunch is over and I gotta go back to dealing with frustrating fork-tongued legislators. However, I'm going to look further into that option to see if maybe I typed something wrong or something.

P.S. Is there a semi-common explanation for why using that code would cause the page to no longer open when typing the www.site.com address? It still worked with the site.com address.
11 years 9 months ago #56696 by joshua.lyon
akmuller wrote:

1) I'm doing most of this work on my lunch breaks, so I appreciate the 'benefit of the doubt.' I don't have a lot of time to work through much. I did however read through the whole post, which leads me to 2...

Sorry if my reply came across as rude - I didn't mean it that way. I understand that a lot of people have limited time to work on their side projects but that also means that those of us who are trying to provide some support (for free) are even more limited in time in working on our own projects. ;)

2) I noticed that there are plenty of people on here still having problems and the fixes aren't working. So the purpose of my post was more along the lines of adding to the people who are having problems with this feature so as to give more credence to the issue.

I'm sure the developers and the rest of us appreciate you adding to the thread, but the disgruntled-ness of my orignal reply came from the lack of details as to what fixes you had tried at the time. Again, I apologize if that came across wrong.

The htaccess fix should work for anyone running Apache assuming they implement it properly. I understand that modifying your htaccess file can be tricky and hard to understand sometimes, but it is really a powerful tool once you get familiar with it. Rereading through the thread, it's not necessarily that the hacks didn't work, but perhaps that they weren't implemented properly.

Some examples follow: I noticed that first user posted an htaccess fix in his update (as a successful fix), the second user dmcgavock seemed like he couldn't figure out the htaccess stuff so he resulted to modifying the code, sultanos couldn't figure out the htaccess or the $loginpost fix, yyviv used the $loginpost fix, tborja didn't mention if they tried the htaccess fix but mentioned that they needed to change the livesite in joomla's configuration.php, and I posted a whole new permanent fix that uses a built-in PHP function to take the URL apart and redirect you to the right location.

I should also note that I would not recommend the $loginpost fix by dmcgavock. It is not a very permanent solution and more of a hack. If you move the site in the future you will end up going through the same stuff again trying to figure out what you hacked together originally to make it work.

3) I tried both the .htaccess fix (which ended up making the site unavailable all together when using the www. maybe I'm doing it wrong....) and the $loginPost fix which seems to have done nothing at all.

Did you apply them at the same time? It's hard for me to know exactly which caused the problem if they were both applied at the same time. Also, as I mentioned above I don't recommend the $loginpost hack (but then again I wrote my own more permanent fix).

4) As I mentioned in my original post, it's Apache.

Sorry I didn't provide clarity to my point. I was trying to explain why I had to come up with the fix and was trying to make a point to other users that might be reading along or find this post in the future. It is clear that you are running Apache and hopefully we can get the htaccess fix working for you.

Thanks for the followup Joshua. I have not yet had a chance to read your article as lunch is over and I gotta go back to dealing with frustrating fork-tongued legislators. However, I'm going to look further into that option to see if maybe I typed something wrong or something.

It's essentially the same as the htaccess fix in the updated first post but has one extra option in it and is an example in the direction you want to go (eg. www redirected to non-www) if I read your post correctly.

P.S. Is there a semi-common explanation for why using that code would cause the page to no longer open when typing the www.site.com address? It still worked with the site.com address.

If you post your htaccess file or send it to me (my e-mail is on my website) I'll try to take a look at it when I have time. It really depends on how you implemented the htaccess fix and what error you got. (eg. a redirection that will never complete, invalid code causing blank page (could be the $loginpost fix done wrong or something else), etc.

Post edited by: joshua.lyon, at: 2008/02/14 00:37

---
Josh
11 years 8 months ago #58740 by sstark
here's the PROPER .htaccess fix:

www.joostdevalk.nl/how-to-remove-www-from-your-url-with-mod_rewrite/

worked for me, and I am using the cb 1.1, J! 1.0.15, php5.2.5, on a VPS

StevenStark.com - Work | Smart-Love.ca - Dating
11 years 7 months ago #60617 by Dark Eagle
thanks people!
the .htaccess rule in the last post combined with the one from the first post made it for me.
i am running Joomla 1.0.15 with CB 1.1 on apache.

i made an .htaccess file with the following content:
[code:1]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteRule ^(.*)$ example.com/$1 [R=301]
[/code:1]

and uploaded it to the root directory of joomla.
So now everyone who came through www.example.com is redirected to example.com .

the important entry in the configuration.php:
$mosConfig_live_site = ' example.com ';

so now at this point everything is working fine. when something bad occurs i will post again.

so far...

Post edited by: Dark Eagle, at: 2008/04/08 23:01

Post edited by: Dark Eagle, at: 2008/04/08 23:07
Moderators: beatnantkrileon
Time to create page: 0.429 seconds
Facebook Twitter Google LinkedIn