WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Fatal error: Call to undefined function get_header() from custom 404 page (2 posts)

  1. robanna
    Member
    Posted 6 years ago #

    Hi, I'm using a custom 404.php page on an IIS server.
    I'm using the wp-404-handler.php

    <?php
    $qs = $_SERVER['QUERY_STRING'];
    $_SERVER['REQUEST_URI'] = substr($qs, strpos($qs, ':80')+3);
    $_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
    include('index.php');
    ? >

    from here but when I enter a bad url I get an error:

    Fatal error: Call to undefined function get_header() in C:\Inetpub\wwwroot\blog\wp-content\themes\glossyblue-1-4\index.php on line 1

    My permalink structure is:
    /index.php/%year%/%monthnum%/%day%/%postname%/

    Any idea what might be causing the error?

  2. robanna
    Member
    Posted 6 years ago #

    DOH!
    wp-404-handler.php needfs to be in root

Topic Closed

This topic has been closed to new replies.

About this Topic