News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Sometimes I get a 404 error from SMF when visiting the forum...

Started by superwormy, May 20, 2009, 08:42:32 PM

Previous topic - Next topic

superwormy

Sometimes if I visit this URL: aoba-metro.org/forum [nofollow]

It forwards me to:
http://www.aoba-metro.org/forum/index.php?PHPSESSID=4d95f4545a37875af7812a46298d9fb1;www [nofollow]

Which then produces a 404 error. However, when I then visit the same URL again... it suddenly works. I believe it's some sort of cookie issue.

Is there a way to fix this / does anyone know why that happens?

Kill Em All

You might want to try going to Admin>Server Settings>Feature config> and enable local storage of cookies. or if it is enabled try disabling it. Tell us how that works for you.


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

superwormy

OK, I tried that, but it doesn't seem to have made a difference. Could it be a stored cookie/session issue? How can I clear all stored cookies/sessions?

kat


superwormy

Ah, to clarify: It is not a browser-dependent thing. (I know how to clear cookies within the browser). It happens on any browser, on any machine. Firefox on Linux, Firefox on Mac, Safari on Mac.

Is there a way to clear the *server side* storage of cookies/sessions, so that I can determine if it's just some sort of corrupted session thing?


superwormy

Kat:
Read the rest of the thread. It's not an issue with a cookie on my computer, and I don't know where the database sessions/cookie data is stored on the server. So, how am I supposed to rename it?

The whole issue is that it redirects my incorrectly when I visit the forum initially, but then works correctly thereafter. Do you have any idea why this would happen?

kat

Admin>server settings>Cookie Name

Try making it "SMFCookie10", or something.

superwormy

Hrm, nope, that doesn't seem to make a difference.

Would SMF be doing the redirecting from aoba-metro.org [nofollow] to www.aoba-metro.org [nofollow], or maybe that's an Apache thing...?

superwormy

I found the answer! Or at least part of it, and a fix!

In Sources/Load.php, line 1229-ish in SMF 1.1.7 looks like this:

      // Hmm... check #2 - is it just different by a www?  Send them to the correct place!!
      if (empty($do_fix) && strtr($detected_url, array('://' => '://www.')) == $boardurl && (empty($_GET) || count($_GET) == 1))
      {
         // Okay, this seems weird, but we don't want an endless loop - this will make $_GET not empty ;).
         if (empty($_GET))
            redirectexit('www');
         else
         {
            list ($k, $v) = each($_GET);

            if ($k != 'www')
               redirectexit('www;' . $k . '=' . $v);
         }
      }

That chunk of code causes the forum to redirect to an incorrect URL if you visit it from aoba-metro.org/forum [nofollow] because the forum is configured as www.aoba-metro.org/forum [nofollow]. This is a *bug* in SMF as far as I'm concerned. I want my forum accessible from either www.aoba-metro.org/forum [nofollow] *OR* aoba-metro.org/forum [nofollow], and I don't want it to redirect my users if they visit it from one URL or the other.

I commented out those lines and it fixed the problem.

JBlaze

Jason Clemons
Former Team Member 2009 - 2012

superwormy

Weird. Same version of SMF? 1.1.7? Maybe it's been fixed in other versions.

JimM

If this is solved please mark it solved by clicking the Mark Topic Solved link at the bottom left of the page.
Jim "JimM" Moore
Former Support Specialist

Advertisement: