Should a non-existing page ever return a 500 internal server error?

If you have a search page that uses get variables eg

and a user comes along and removes the end part leaving

would it not be expected to return you to a search form/page and at worst return an error 404 page? In 2 places on our newly rebuilt website if i remove the query part it returns a blank page that on investigation is a 500 internal server error!!

surely there is no reason it should ever return a 500 error? or am i missing something?

What server-side language is being used?


I should probably explain it is a page that has been built already by someone that isn’t me. Rather than a problem i am having with my own code.

Any errors show in PHP’s error logs?

I would expect it to do whatever it is you set it up to do in the given circumstances.
This could be covered in htaccess or your php.
So you decide what should happen, then make that happen.
Eg. in php:-

    // do something with this
    // do something else instead

The something else is whatever you want to happen in such circumstances. It could be a header with a 404 code, or redirect to some other page, anything you want.

Do you have any .htaccess directives that act on search?this=something?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.