views:

197

answers:

1

I have a file outside a Wordpress install that contains a form that submits to itself. I can access and fill the form out, without validation the form submits and reloads as expected, but when using javascript to submit the form I receive a Wordpress 404. The URL of the file stays the same when receiving the 404, if I refresh the page it works fine, no 404.

I don't know what the difference would be between the two methods of submitting the form, why would wordpress get involved in one over the other?

I guess a simple solution would be to update my .htaccess mod_rewrite rules to explicitly ignore the file, could anyone help with that? Any other suggestions as to the differences between the two methods (form submit v.s javascript submit) would be greatly appreciated, I just can't think of why this would happen.

A: 

I tracked down the issue to the form processing. Looking in the logs I found a "Premature end of script headers" error was throwing a 500 Internal Server Error, resulting in a 404 error while trying to use an ErrorDocument to handle the request... the 404 was being handled by wordpress. The premature end of script was caused by some mysql connection code... but in other cases could be caused by an emailer or other form processing scripts. Hope that helps others who run into this problem.

Anthony