"Unable to verify referring URL. Please go back and try again." error SMF 2.1.2

Started by Tascio, August 05, 2022, 11:33:34 AM

Previous topic - Next topic

Tascio

"Unable to verify referring URL. Please go back and try again." error in SMF 2.1.2, the only mod I have installed is Optimus.

I keep getting the above error every time I try to log into the admin area of my forum, it has been happening for years, but I thought that sooner or later, updating the forum would fix it, but that hasn't worked out.

After receiving the error I can then re-enter my password and I am able to log in.

Error Information:

Error

Type of error

User

Error message

Unable to verify referring URL. Please go back and try again.

URL of page causing the error

https://[My URL].co.uk/index.php?action=admin;area=logs;sa=errorlog;desc=

Backtrace information

#0: fatal_lang_error()
Called from /home/[Username]/public_html/[My URL].co.uk/Sources/Security.php on line 707

#1: checkSession()
Called from /home/[Username]/public_html/[My URL].co.uk/Sources/Security.php on line 65

#2: validateSession()
Called from /home/[Username]/public_html/[My URL].co.uk/Sources/Admin.php on line 457

#3: AdminMain()
Called from /home/[Username]/public_html/[My URL].co.uk/index.php on line 191

Any help gratefully received.

Kindred

1- what is the URL for your site (in server settings)? (for example www or no www)
2- What URL are you using to accessing the site? (for example www or no www)

3- do you have an htaccess redirect?
4- are you using http or https?
5- are you using a subdomain?

Please do tell us your actual URL so we can take a look.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Tascio

1) I can't see this setting anywhere in server settings, the only URL related thing I can see is "Forum SSL mode" which is enabled.

2) I am using https://www. to access the site, which then switches to just https:// once I am in the admin area.

3) I have no htaccess redirect as far as I can see, just a whole lot of problem IP's blocked in htaccess.

4) I am using https.

5) I am not using a subdomain.

6) You can visit the site at https://www.ufoforum.co.uk/ [nofollow]

Tascio

Ok, accessing the site from the same url that the admin area is set to seems to make the problem go away, it was the "www" causing the problem I guess?

Kindred

Yes, that's what I suspected.
Add a force redirect in .htaccess to use whatever your actual setting is (sounds like non-www)

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver


# 301 REDIRECT HTTP TO HTTPS AND WWW TO NON-WWW
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
</IfModule>


You can also do this in cPanel > Domains > Redirects


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Kindred

Sir osis, that's wrong.

He needs the NON-WWW address redirect
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

That's odd, I posted a reply yesterday but it's gone.

Anyway, thought OP needed it other way round.


# Redirect to www
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Kindred

No, you did post it.   I had deleted that, and intended to delete my post saying you were wrong, because I reread your original post and it was correct.

I can only blame my lack of coffee.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Steve

DO NOT pm me for support!

Tascio

Thank you for your replies!

But I am not clear, should I use the first code block Sir Osis of Liver posted or the second block, they are quite different?

Again, thank you for your help!

Kindred

Quote from: Sir Osis of Liver on August 05, 2022, 10:33:09 PM
# 301 REDIRECT HTTP TO HTTPS AND WWW TO NON-WWW
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
</IfModule>


You can also do this in cPanel > Domains > Redirects




use this one.... :D  I've had my coffee today.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."


Tascio

If I wanted to switch to using www. what should I put into .htaccess? I really don't want to break anything at this point, now that everything seems to be working!

Sir Osis of Liver

Quote from: Sir Osis of Liver on August 07, 2022, 02:05:47 PM
# Redirect to www
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


If your host account is running cpanel, you can do it in Domains > Redirects >

www. redirection:

Only redirect with www.
Redirect with or without www.
Do Not Redirect www.

Check the middle option.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters


Kindred

Don't forget that you'll have to update your smf server settings to use the www as well. Otherwise you'll get into a redirect loop
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: