Posted By

kyuumeitai on 08/28/10


Tagged

wordpress ignore physical 404


Versions (?)

Wordpress - 404 problem on physical directories


 / Published in: PHP
 

URL: http://wordpress.org/support/topic/404-on-custom-non-wordpress-pages

Wordpress - 404 problem on physical directories. From the Support Forum.

  1. add_filter( 'status_header', 'mf_hack_404', 10 );
  2. function mf_hack_404( $c ) {
  3. if( defined( 'GALLERY_NAME' ) ) {
  4. $header = '200';
  5. $text = get_status_header_desc( $header );
  6. $protocol = $_SERVER["SERVER_PROTOCOL"];
  7. if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol )
  8. $protocol = 'HTTP/1.0';
  9.  
  10. return "$protocol $header $text";
  11. }
  12. else
  13. return $c;
  14. }

Report this snippet  

You need to login to post a comment.