some my fixes
function blocks404_preprocess_page(&$vars, $hook) {
- if (strpos(drupal_get_headers(), 'HTTP/1.1 404 Not Found') !== FALSE) {
+ if (strpos(drupal_get_headers(), $_SERVER['SERVER_PROTOCOL'].' 404 Not Found') !== FALSE) {
module_load_include('inc', 'blocks404', 'blocks404.active');
_blocks404_preprocess_page($vars);
}
Comments
Comment #1
johnalbinIts hardcoded in Drupal core: http://api.drupal.org/api/function/drupal_not_found/6
So I have to search for the exact same string in my module.
This doesn't appear to be a bug. Why would your implementation be better than hardcoding "HTTP/1.1"?
Comment #2
dema502 commentedI use drupal+apache on backend and ngnix on frontend
Nginx request apache by HTTP/1.0 protocol and this check (strpos(drupal_get_headers(), 'HTTP/1.1 404 Not Found') is not working.
Comment #3
johnalbinBut as I said, Drupal hard codes that string in http://api.drupal.org/api/function/drupal_not_found/6
This module just looks for that string. How is that your system doesn't have the string that Drupal hard-coded into the headers? :-\
Comment #4
johnalbinI'd love to discuss this more. But without more information, there's nothing for me to fix, afaik. Please re-open if you'd like to continue the discussion. :-)