2

In short, Magento returns status 200 for the 404 Not Found CMS page, for what seems to be a pretty standard configuration:

enter image description here

Everything works fine when the URL is changed to cms/index/defaultNoRoute, the default Not Found page is loaded with status 404.

Also, absolutely everything works fine on a copy of the website on a different server. Which would lead me to suspect the Apache configuration. Not sure though what to look out for.

Here are response headers for both defaultNoRoute and noRoute actions:

$ curl -I http://www.server.com/cms/index/defaultNoRoute
HTTP/1.1 404 Not Found
Date: Thu, 25 Apr 2013 12:56:07 GMT
Server: Apache
X-Powered-By: PHP/5.2.17
Set-Cookie: frontend=332f53c81eee1f730f430c0f59e0dd83; expires=Thu, 25-Apr-2013 13:56:08 GMT; path=/; domain=www.server.com; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Status: 404 File not found
Vary: Accept-Encoding,User-Agent
Content-Type: text/html; charset=UTF-8

$ curl -I http://www.server.com/cms/index/noRoute
HTTP/1.1 200 OK
Date: Thu, 25 Apr 2013 12:56:11 GMT
Server: Apache
X-Powered-By: PHP/5.2.17
Set-Cookie: frontend=361b3804feaea66a6fcdf1aee048ce44; expires=Thu, 25-Apr-2013 13:56:12 GMT; path=/; domain=www.server.com; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Vary: Accept-Encoding,User-Agent
Content-Type: text/html

Anyone can point me in the right direction? Cheers.

4

In my experience this is most often caused by poorly written CMS integrations. It's not uncommon for a CMS integration to rewrite the noRoute action to catch when Magento would issue a 404, grab content from a CMS (if available) and then serve it up in the content section of the page.

What goes wrong, however, is when these custom integrations then fail to detect when they also do not have content for the URL in the CMS and indiscriminately send out a 200 response code with either blank content or a 404 content page served from the CMS (but with a 200 response code).

In the case of no content, in this type of integration, the trick is to simply forward the request to the default no route action and/or fall through and let the parent controller method handle the 404 response.

Do you have a CMS integration module of some sort installed? If so, I would suggest isolating it to either prove or rule it out as the cause.

| improve this answer | |
  • That would make perfect sense, Wordpress and Fishpig Wordpress integration is installed on the website. The problem is, though, everything works fine on the dev copy of the website... – Jan Tomka Apr 29 '13 at 2:17
  • 1
    Are both dev and production servers case-sensitive? – davidalger Apr 29 '13 at 14:25
  • Nope, the dev server, where it works, is an OS X with case insensitive FS. – Jan Tomka Apr 29 '13 at 23:54
  • 1
    That is why I brought up the file-system needing to have the same case-sensitivity on both instances. Having case-insensitive on dev can easily cause things to work on dev which won't work (and sometimes cause utter failure) on production. – davidalger Apr 30 '13 at 13:24
  • 2
    Another possibility is that some modules are loading in a different order on production. I've seen it happen, and the only way to solve it is by setting the dependencies correctly in the modules where it affects the operation of the code. – davidalger Apr 30 '13 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.