Problem with External Form (doesn't submit, causes "Page Not Found" -error)


I am trying to build an External Form on Conrete5.7.2.1. However, even the "Test Form" that comes with C5 does not work. The problem seems to be the form's submit action.

The Test Form's action URL prints out "/index.php/test_search", which only seems to give a "Page Not Found" error on form submit.

Any ideas as to what might be causing the problem? Is the form action URL incorrect?


View Replies:
BermudaSam replied on at Permalink Reply
Actually it seems that I am having the same exact problem with the default C5 Form Blocks as well. The form won't submit, but returns a Page not found error instead.

Could this be some kind of a server setup issue - wrong PHP version or something like that?

Any help would be appreciated!
codifyio replied on at Permalink Reply
Can you just try changing the action URL to whatever page you put the external form on? If the external form is on a page named home, change the action URL to home. The action URL is simply looking for a page that doesn't exist. Or you could make a new page called test_page and put the external form on that page, using the action test_page. In the past three weeks I built an entire web app using just external forms. External forms work fine.
BermudaSam replied on at Permalink Reply
Thanks! I tried manually changing the action URL to the page URL the form is on, but this just results to the page loading again upon pressing Submit. Then again, I don't understand how the form could be submitted this way - it doesn't have information about the action defined in the External form's Controller that actually handles the form submission, right? Also, setting the action URL to /page-name/action-name results to Not found error. Did I miss something here?

Forms seem to work fine on my local installation of C5, so that's why I am suspecting a PHP version / server related problem.
mesuva replied on at Permalink Reply
Nearly 100% of the time when I'm doing something in concrete5 and I perform some sort of action where I am posting data and I get a sudden and unexpected Not Found error, it's been because 'Mod Security' on the server has kicked in and blocked the request, incorrectly thinking it is malicious.

My suggestion would be the ask your host if 'Mod Security has triggered any rules lately'.
If so, they should come back with that info, and if it looks like it's on the same URLs where you are posting your forms, ask them to 'whitelist' the rules being triggered.
BermudaSam replied on at Permalink Reply
Thank you! I'll ask about "Mod Security" from my service provider.

I'll post here, if/when I get an answer from them.
BermudaSam replied on at Permalink Reply
OK, the service provider did *something* on the server and now the forms seem to work as expected. It's always nice to know what's going on...

Thanks for the replies everyone! I'm sorry I can't give you any specific information as to what actually caused to problems to begin with, but I guess it was some server side setting or what not.