MyBB Community Forums

Full Version: Redirect login problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey, there is problem with our site when member login without www. on my site login do not work, but when login with www. on my site login working fine and logged successfully. is there any solution to get work also without www. and get logged? thanks
what is your forum url ?

you have to redirect non-www url to www url
either by using redirect facility at web host panel or by using rewrite rules (in .htaccess)
Here some code in my htaccess

<IfModule mod_rewrite.c>
RewriteEngine on

# Some hosts need a RewriteBase specification.
RewriteBase /

# Make this rule the first rewrite rule in your .htaccess!
RewriteRule ^([^&]*)&(.*)$ http://www.mysite.com/$1?$2 [L,QSA,R=301]


Edit: Fixed adding below code in my htaccess

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.yoursite\.com
RewriteRule (.*) http://www.yoursite.com/$1 [R=301,L]
Perhaps he is using the .htaccess like that, not knowing he should have changed the "mysite.com" and "yourside.com" to his site url.

So first, change myside and yourside to your forum url. Then add this at the end of the .htaccess
#RewriteCond %{HTTP_HOST} ^sitename\.com$[OR]
#RewriteCond %{HTTP_HOST} ^www\.sitename\.com$
#RewriteRule ^/?$ "http\:\/\/sitename\.com\ [R=301,L]

Remember to change "sitename" and extension (.com in the example) to your forum url and extension