logged in modules not showing

15 years 6 months ago #77904 by flights of fancy
Replied by flights of fancy on topic Re:logged in modules not showing
Many thanks.

I'll look into it.

FoF

Please Log in to join the conversation.

15 years 6 months ago #77970 by flights of fancy
Replied by flights of fancy on topic Re:logged in modules not showing
Hi,
Just for completion on this one, having checked it out a bit.

In public html use the .htaccess file (mine contained a redirect to .htaccess.addHandlerBak which itself was an empty file, so deleted file and reference in .htaccess).

Add this code to .htaccess

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^bournecentral\.com$
RewriteRule (.*) bournecentral.com/$1 [R=301,L]

(Substitute your domain for mine - this is all the code I have in my file but you may have other code you need so don't delete without checking its value)

This sets the site to non-www. (setting my site to www. resulted in login not working at all)

There are several versions of this code around but this one worked for me (combining two versions).

References:
www.bluehostforum.com/showthread.php?s=875e5d82f0f20b190157bae8e9c16fac&t=11529&highlight=non-www

www.seo-consultant-services.co.uk/301-redirects-www-non-www-canonical-problems.html

Glad to be part of the community here and look forward to further correspondence!

FoF

Please Log in to join the conversation.

15 years 5 months ago #81107 by beat
Replied by beat on topic Re:logged in modules not showing
Here is a fix for mambo and joomla 1.0 installations that workaround the www/non-www issues in joomla 1.0 (joomla 1.5 is not affected by this):

open file mod_cblogin.php :

Search for line:
[code:1] echo '<form action="'.$loginPost.'" method="post" id="mod_loginform'.$class_sfx.'" ';
[/code:1]

and insert just before that line:

[code:1] // now we need to make sure that the cookie in return of this post is sent to the most generic domain, in case multiple domains exist:
// if the current page ($return) is without www, then login should also be without www, even if live_site has www:
if (strncasecmp($loginPost, "http://www.", 11)==0 // && strncasecmp($cblogin_live_site, "http://", 7)==0
&& strncasecmp( substr($loginPost, 11), substr($return, 7), $len_live_site - 11 ) == 0 ) {
// the login return string matches the live site without 'www.' in it:
// add www subdomain as live_site has it.
$loginPost = "http://" . substr($loginPost, 11);
} elseif (strncasecmp($loginPost, "https://www.", 12)==0 // && strncasecmp($cblogin_live_site, "https://", 8)==0
&& strncasecmp( substr($loginPost, 12), substr($return, 8), $len_live_site - 12 ) == 0 ) {
$loginPost = "https://" . substr($loginPost, 12); // same for https
}
[/code:1]

I would be very thankful if you all in here could quickly test that fix, if possible today...(yes i know it's short notice)...so we can include it in RC4 :)

Please test as follows:
- apply fix
- remove from your .htaccess the autoredirection added
- make sure your live_site has no www. in it
- go to your site with url WITH www. in front
- try logging in
- see that it fails
- apply fix
- try again logging in in same condition and see that it works
- logout
- try logging in the site without www


Thanks

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.195 seconds

Facebook Twitter LinkedIn