SMF Redirects to root's index.php

Started by Pyrhel, January 25, 2014, 09:56:56 PM

Previous topic - Next topic

Pyrhel

Hello everyone :)

I have a strange problem with my SMF 2.0.7 setup. I have a shared hosting and in it's public_html I have an wordpress installation. In the wordpress directory (root dir) there is a "forum" dir which have the SMF. Everything works perfectly, but this night I hit a problem.

When I try to edit the smiley's order, after choosing the new location for the smiley, the SMF redirects me to the wordpress and the WP says "404 Not Found".

Then i've removed the index.php from the wordpress, also removed the root's .htaccess file and tried again, this time i had a server error:
[Sun Jan 26 04:39:33 2014] [error] [client ...] File does not exist: /home/fordclub/public_html/fordbg.com/index.php, referer: http://fordbg.com/forum/index.php?action=admin;area=smileys;sa=setorder;move=359  :o

I'm really lost, because all other actions work fine, do you have any ideas?

Thank you!

Arantor

I'd seriously wonder what is in the .htaccess file of the WP install... it's known to cause a lot of havoc with SMF.

azasmith

Wordpress handles all 404 errors on your site (unless you remove it from .htaccess, not really any point removing it) If a page isn't found, it in essence redirects you back to your wordpress site, with your themes 404.php. Whilst still showing you the URL you were looking for, a form of mod_rewrite basically. The error you received is because you deleted index.php, this is a required file and should ideally be put back.   

The bigger issue would be why SMF is giving you the 404 page when you try and change your smiley positions. I'm sure Cumberpatch will correct me if I'm wrong, but I don't think 2.0.7 made any changes to anything smiley related. Did this work when you were on 2.0.6? I've just checked moving a smiley on my 2.0.7 install and it worked fine. Does it do this with ALL smileys you try to move? Or just smiley 359?

Arantor

Nothing to the admin panel, anyway. There were internal changes to how smileys were parsed for the purposes fo PHP 5.5 compatibility but nothing in the management area.

Pyrhel

I read the 2.0.7 patch and I saw what it changes. Just saying the version. I don't know if it was working before the update, because I haven't do anything with the smiles for a long time - more than an year.

I was digging into the request, the normal one is
http://fordbg.com/forum/index.php?action=admin;area=smileys;sa=setorder;location=postform;source=16;after=359;reorder=1

When i remove the "location" parameter everything works fine:
http://fordbg.com/forum/index.php?action=admin;area=smileys;sa=setorder;source=16;after=359;reorder=1

The more strange thing to me is why SMF which is in the /forum directory redirects to / dir. This happens WITH and WITHOUT the .htaccess from the root.

azasmith

Quote from: Pyrhel on January 26, 2014, 07:30:54 AM
The more strange thing to me is why SMF which is in the /forum directory redirects to / dir. This happens WITH and WITHOUT the .htaccess from the root.

Your browser may have cached .htaccess, which would still have taken you to /dir even though it was removed. (could be worth trying in a different browser for example)

I will leave the location parameter stuff to someone slightly more skilled in SMF as I'm still trying to learn the ropes etc etc. But at least you found a temporary fix for your issue. Do you have any smiley mods installed?

Arantor

.htaccess should never under any circumstances be sent to the browser, Apache even explicitly has a rule in its master configuration file to never serve any files beginning with .ht (configurable because you might rename them something else)

I'm wondering if this is a mod_security issue.

azasmith

Quote from: Sir Cumber-Patcher on January 26, 2014, 11:50:40 AM
.htaccess should never under any circumstances be sent to the browser, Apache even explicitly has a rule in its master configuration file to never serve any files beginning with .ht (configurable because you might rename them something else)

I'm wondering if this is a mod_security issue.

Sorry, yes, you're correct, I was referring to the redirect response from inside .htaccess. (Assuming OP simply tried to move the smiley again to trigger the same 404 and not attempt to go to /forum/hghghgh/ for example) my LAMP knowledge is still a bit rusty. So that's about as much use as I can be to this thread.  :laugh:

Pyrhel

Can you give me any suggestions how can I debug this issue? I don't know where to start and what to check.
I'm not sure if i can check the apache mod_'s because it's shared hosting, not on my server anymore :(

azasmith

Quote from: Pyrhel on January 26, 2014, 03:50:33 PM
Can you give me any suggestions how can I debug this issue? I don't know where to start and what to check.
I'm not sure if i can check the apache mod_'s because it's shared hosting, not on my server anymore :(

You can still contact your host and ask them if mod_security is enabled on your hosting. It's also a reasonable request to ask them to turn it off.

Pyrhel

Hah, I was playing with that parameter and shrink the problem. When there is a"form" word in the url, for example "testparam=testform", then the /forum/index.php is not found.
BUT!!! If I put the "testparam=testform" at the end of the url - everything is OK. One more thing, if there is something after the "form", for example "testparam=testformvalue" - this works again. WTF :D

Arantor

That definitely smells like mod_security.

Pyrhel

Awesomeness! Mod_security was the problem, the host disabled said that they disabled it partially and now it runs fine.

Still, I have a problem with adding new smileys, but maybe the cause is different. I'll dig a little bit more before i squeal :)

Thank you, Sir Cumber-Patcher :)

bdtcomp

Pyrhel did you ever solve your 'add new Smileys? I have posted this in another thread. I changed my forum form Windows to Linux. BUT I also upgraded in patches from 2.0.2 to 2.0.8. So it is possible that the problem aroused from updating, but not sure.

Pyrhel

Yes, I did. The problem was in the mod_security. The hosting support disabled it and everything runs ok :)

bdtcomp

Thanks Pyrhel, I don't know if GoDaddy will do, but I've called them enough, and some of the techs know me. I get some of the same people when I call. 8)

Advertisement: