News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Login error on 2.1.1

Started by pikeman, March 06, 2022, 11:44:29 AM

Previous topic - Next topic

pikeman

When I try to log in to the forum via a link that has www (https://www.vukovisadunava.com/) I get an error. Occurs with and without Pretty URLs included.


Doug Heffernan

Quote from: pikeman on March 06, 2022, 11:44:29 AMWhen I try to log in to the forum via a link that has www (https://www.vukovisadunava.com/) I get an error. Occurs with and without Pretty URLs included.


Is there any specific message logged in the error log pertaining to this?

Arantor

Your problem is that the site is configured to not use www but you used it in your link - this is crossing a domain and not generally liked by things.

Pick whether the site should have www or not, and whichever one you're not using, force a redirect to the other so everything is on the same setup.

pikeman


Doug Heffernan

Quote from: pikeman on March 06, 2022, 01:00:56 PMSolved, thanks! :)

Glad to hear that you got it solved. Do you mind to post the solution here as it can help other people who might run into the same issue.

Illori

Quote from: Arantor on March 06, 2022, 11:54:02 AMPick whether the site should have www or not, and whichever one you're not using, force a redirect to the other so everything is on the same setup.

Arantor posted the fix above.

pikeman

Of course :D , I added the last of these codes to the htaccess file:

To redirect non-www to www
RewriteCond %{HTTP_HOST} ^your_domain.com$
RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]

To redirect www to non-www
RewriteCond %{HTTP_HOST} ^www.your_domain.com$
RewriteRule ^(.*)$ http://your_domain.com/$1 [R=301]

To redirect non-www to www (while using SSL)
RewriteCond %{HTTP_HOST} ^your_domain.com$
RewriteCond %{SERVER_PORT} ^443
RewriteRule ^(.*)$ https://www.your_domain.com/$1 [R=301]

To redirect www to non-www (while using SSL)
RewriteCond %{HTTP_HOST} ^www.your_domain.com$
RewriteCond %{SERVER_PORT} ^443
RewriteRule ^(.*)$ https://your_domain.com/$1 [R=301]

Doug Heffernan

Quote from: pikeman on March 06, 2022, 01:11:57 PMOf course :D , I added this code to the htaccess file:


To redirect non-www to www
RewriteCond %{HTTP_HOST} ^your_domain.com$
RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]

To redirect www to non-www
RewriteCond %{HTTP_HOST} ^www.your_domain.com$
RewriteRule ^(.*)$ http://your_domain.com/$1 [R=301]

To redirect non-www to www (while using SSL)
RewriteCond %{HTTP_HOST} ^your_domain.com$
RewriteCond %{SERVER_PORT} ^443
RewriteRule ^(.*)$ https://www.your_domain.com/$1 [R=301]

To redirect www to non-www (while using SSL)
RewriteCond %{HTTP_HOST} ^www.your_domain.com$
RewriteCond %{SERVER_PORT} ^443
RewriteRule ^(.*)$ https://your_domain.com/$1 [R=301]

Thanks for posting a detailed solution.

pikeman


Advertisement: