MyBB Community Forums

Full Version: Login/Logout problems? PLEASE READ
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
You should allow your forum to be only access with www. Or without it. It's bad for SEO and can cause issues with cookies.

Add either of the following to your .htaccess in the MyBB root folder or to the htaccess.txt (make sure you rename it to .htaccess) making sure it's at the top of the MyBB SEF section:

For redirecting non www. to www.
RewriteCond %{HTTP_HOST} ^mscenter.ir
RewriteRule (.*) http://www.mscenter.ir/$1 [R=301,L]

For redirecting www. To non www.
RewriteCond %{HTTP_HOST} ^www.mscenter.ir
RewriteRule (.*) http://mscenter.ir/$1 [R=301,L]

Your current settings should be fine for both:
$settings['cookiedomain'] = ".mscenter.ir";
$settings['cookiepath'] = "/";
$settings['cookieprefix'] = "";

Also try clearing your cookies or testing in different browsers. I too can use the test account to login and log out successfully.
my htdocs

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.mscenter.ir
RewriteRule (.*) http://mscenter.ir/$1 [R=301,L]

# Some hosts require RewriteBase to make RewriteRules work.
RewriteBase /

# Google SEO workaround for search.php highlights:
# Make this rule the first rewrite rule in your .htaccess!
RewriteRule ^([^&]*)&(.*)$ http://mscenter.ir/$1?$2 [L,QSA,R=301]

# Google SEO 404:
ErrorDocument 404 /misc.php?google_seo_error=404

# Google SEO Sitemap:
RewriteRule ^sitemap-([^./]+)\.xml$ misc.php?google_seo_sitemap=$1 [L,QSA,NC]

# Google SEO URL Forums:
RewriteRule ^Forum-([^./]+)$ forumdisplay.php?google_seo_forum=$1 [L,QSA,NC]

# Google SEO URL Threads:
RewriteRule ^Thread-([^./]+)$ showthread.php?google_seo_thread=$1 [L,QSA,NC]

# Google SEO URL Announcements:
RewriteRule ^Announcement-([^./]+)$ announcements.php?google_seo_announcement=$1 [L,QSA,NC]

# Google SEO URL Users:
RewriteRule ^User-([^./]+)$ member.php?action=profile&google_seo_user=$1 [L,QSA,NC]

# Google SEO URL Calendars:
RewriteRule ^Calendar-([^./]+)$ calendar.php?google_seo_calendar=$1 [L,QSA,NC]

# Google SEO URL Events:
RewriteRule ^Event-([^./]+)$ calendar.php?action=event&google_seo_event=$1 [L,QSA,NC]
RewriteCond %{HTTP_HOST} ^mscenter\.co$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mscenter\.co$
RewriteRule ^/?$ "http\:\/\/mscenter\.ir" [R=301,L]

my settings :

$settings['cookiedomain'] = ".mscenter.ir";
$settings['cookiepath'] = "/";
$settings['cookieprefix'] = "";

my problem is not solved!!
Perhaps this is the correct way of doing it (looked at the rule at the bottom):
RewriteCond %{HTTP_HOST} ^www\.mscenter\.ir
RewriteRule ^/?$ "http\:\/\/mscenter\.ir" [R=301,L]

Did you clear your cookies or use a different browser?
Ive done everything in the thread.

The problem is for everyone logging in and logging out.

My url: www.TheVirtualMarket.net
i clear my cache and cookie , use diffrent browser too ! but it is n't solveddddddddd !!!!!!!!!!

my htaccess
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.mscenter.ir
RewriteRule (.*) http://mscenter.ir/$1 [R=301,L]

# Some hosts require RewriteBase to make RewriteRules work.
RewriteBase /

# Google SEO workaround for search.php highlights:
# Make this rule the first rewrite rule in your .htaccess!
RewriteRule ^([^&]*)&(.*)$ http://mscenter.ir/$1?$2 [L,QSA,R=301]

# Google SEO 404:
ErrorDocument 404 /misc.php?google_seo_error=404

# Google SEO Sitemap:
RewriteRule ^sitemap-([^./]+)\.xml$ misc.php?google_seo_sitemap=$1 [L,QSA,NC]

# Google SEO URL Forums:
RewriteRule ^Forum-([^./]+)$ forumdisplay.php?google_seo_forum=$1 [L,QSA,NC]

# Google SEO URL Threads:
RewriteRule ^Thread-([^./]+)$ showthread.php?google_seo_thread=$1 [L,QSA,NC]

# Google SEO URL Announcements:
RewriteRule ^Announcement-([^./]+)$ announcements.php?google_seo_announcement=$1 [L,QSA,NC]

# Google SEO URL Users:
RewriteRule ^User-([^./]+)$ member.php?action=profile&google_seo_user=$1 [L,QSA,NC]

# Google SEO URL Calendars:
RewriteRule ^Calendar-([^./]+)$ calendar.php?google_seo_calendar=$1 [L,QSA,NC]

# Google SEO URL Events:
RewriteRule ^Event-([^./]+)$ calendar.php?action=event&google_seo_event=$1 [L,QSA,NC]
RewriteCond %{HTTP_HOST} ^www\.mscenter\.ir
RewriteRule ^/?$ "http\:\/\/mscenter\.ir" [R=301,L]

my settings :
$settings['cookiedomain'] = ".mscenter.ir";
$settings['cookiepath'] = "/";
$settings['cookieprefix'] = "";
(2013-10-11, 11:32 AM)Matt. Wrote: [ -> ]I can login and logout no problems. Does it work in any other browsers?

Hi Matt,
I have just upgraded my forum from 1.6.10 to 1.6.11
I have no problems with 1.6.10 version.
I fixed the file settings.php as your guide but i can not logout my account, i use the firefox version 24.0
I can login and logout no problems on IE 11 and Chrome Version 30.0.1599.101

Help me please!
Nothing changed in 1.6.11 that would have broken this, what's your URL?
(2013-10-19, 06:30 PM)Matt. Wrote: [ -> ]Nothing changed in 1.6.11 that would have broken this, what's your URL?

thank you so much, after i clear all cache in firefox so i can logout no probblems.
thanks Matt
is there anyone who can solve my problem ?
^ would you like to PM me temporary access to admin panel & ftp (you can change the credentials later)
however, now it is late midnight for me ..