Title: Problems with 404
Last modified: August 19, 2016

---

# Problems with 404

 *  [callbarney](https://wordpress.org/support/users/callbarney/)
 * (@callbarney)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/problems-with-404/)
 * Hi All,
 * My website is [http://www.PartyEventsUnlimited.co.uk](http://www.PartyEventsUnlimited.co.uk)
   and im having problems with my error handling.
 * I have tried everything I can thing of but for some reason my error page (404.
   php) seems to be loading in plain text. I’ve check all versions (in the theme
   and home directory) and they are all correct (And the same). I have literally
   copied and implemented my theme into the default wordpress 404 page.
 * Take a look at any page i.e. [http://www.PartyEventsUnlimited.co.uk/404testing](http://www.PartyEventsUnlimited.co.uk/404testing)
   and see for yourself…
 * I have tried ammending the .htaccess file with no luck so hopefully someone can
   help me solve this

Viewing 15 replies - 1 through 15 (of 26 total)

1 [2](https://wordpress.org/support/topic/problems-with-404/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/problems-with-404/page/2/?output_format=md)

 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/problems-with-404/#post-1390721)
 * Where’s the rest of the document, there’s no opening HTML or PHP tag..
 * Please post the complete code from the file in question into a pastebin.
    [http://wordpress.pastebin.ca/](http://wordpress.pastebin.ca/)
 * Then report the link back here, and i’ll take a look for you.
 * And please do not bump the thread, you actually reduce your chances of getting
   help by doing that on these forums (volunteers check threads with no replies,
   you look like you’re getting help by replying to yourself).
 *  [Shane G.](https://wordpress.org/support/users/shane-g-1/)
 * (@shane-g-1)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/problems-with-404/#post-1390724)
 * Hi,
 * Reset your permalink from wordpress admin area and add this code in htaccess 
   of your site/blog:
 *     ```
       # BEGIN WordPress
   
       <IfModule mod_rewrite.c>
       ErrorDocument 404 /index.php?error=404
       RewriteEngine On
       RewriteBase /
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
   
       # END WordPress
       ```
   
 * Now, check with old and new posts of your blog.
 * Thanks,
 * Shane G.
 *  Thread Starter [callbarney](https://wordpress.org/support/users/callbarney/)
 * (@callbarney)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/problems-with-404/#post-1390814)
 * Hi Shane… tried that and no luck…
 * Here is the pastebin of my 404 page
 * [http://wordpress.pastebin.ca/1807373](http://wordpress.pastebin.ca/1807373)
 * I have found if I go to my 404 page at [http://www.partyeventsunlimited.co.uk/404](http://www.partyeventsunlimited.co.uk/404)
   it loads correctly
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/problems-with-404/#post-1390821)
 * 404 template files should be placed inside the theme folder.
 * [http://codex.wordpress.org/Creating_an_Error_404_Page](http://codex.wordpress.org/Creating_an_Error_404_Page)
 *  Thread Starter [callbarney](https://wordpress.org/support/users/callbarney/)
 * (@callbarney)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/problems-with-404/#post-1390822)
 * yes it is
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/problems-with-404/#post-1390823)
 * Well since the file doesn’t contain any form of header there’s no way for the
   server to know what to do with the file..
 * There’s no opening HTML tag .. and there’s no PHP at the start of the file, so
   it’s read as plain text.
 * See the example given on the link i provided.
 *  Thread Starter [callbarney](https://wordpress.org/support/users/callbarney/)
 * (@callbarney)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/problems-with-404/#post-1390826)
 * I’ve not just uploaded the simpled page and still get a blank page
 *     ```
       <html>
       <head>
       <title>404 Error Page</title>
       </head>
       <body>
   
       <p>Looks like we have an error</p>
   
       </body>
       </html>
       ```
   
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/problems-with-404/#post-1390827)
 * If you followed the examples on the link i provided you’d likely have a working
   404 page by now..
 * So again, see the link provided previously please..
 *  Thread Starter [callbarney](https://wordpress.org/support/users/callbarney/)
 * (@callbarney)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/problems-with-404/#post-1390828)
 * I have done so…
 * I have now got my error page as:
 *     ```
       <?php get_header(); ?>
          <div id="content" class="narrowcolumn">
            <h2 class="center">Error 404 - Not Found</h2>
       	</div>
       <?php get_sidebar(); ?>
       <?php get_footer(); ?>
       ```
   
 * and my .htaccess (which is in the same location as the index.php in the main 
   root folder) is
 *     ```
       # BEGIN WordPress
   
       <IfModule mod_rewrite.c>
       ErrorDocument 404 /index.php?error=404
       RewriteEngine On
       RewriteBase /
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
   
       # END WordPress
       ```
   
 * and its still opening in plain text.
 * I also notice that if I go to [http://www.partyeventsunlimited.co.uk/index.php?error=404](http://www.partyeventsunlimited.co.uk/index.php?error=404)
   I am automatically redirected to [http://www.partyeventsunlimited.co.uk/?error=404](http://www.partyeventsunlimited.co.uk/?error=404)
   which takes me to my index page (nothing like my error page layout except the
   header and footer).
 * hmmm getting quite stumped…
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/problems-with-404/#post-1390829)
 * Is your custom file in the theme folder _and named 404.php_?
 *  Thread Starter [callbarney](https://wordpress.org/support/users/callbarney/)
 * (@callbarney)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/problems-with-404/#post-1390830)
 * yes
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/problems-with-404/#post-1390831)
 * Get rid of this line..
 *     ```
       ErrorDocument 404 /index.php?error=404
       ```
   
 * Then try an invalid url again.. and see if you get the 404 page..
 * For all intents and purposes, the two urls(`index.php?error=404` and `?error=
   404`) are actually the same thing anyway.
 *  Thread Starter [callbarney](https://wordpress.org/support/users/callbarney/)
 * (@callbarney)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/problems-with-404/#post-1390832)
 * nope no fix….
 * Interesting, I changed my permalinks back to the default setting and it appears
   to load my homepage when any invalid addresses are quested… but when I go to
 * [http://www.partyeventsunlimited.co.uk/404.php](http://www.partyeventsunlimited.co.uk/404.php)
 * I get
 * `Fatal error: Call to undefined function get_header() in /home/fhlinux142/p/partyeventsunlimited.
   co.uk/user/htdocs/404.php on line 8`
 * and on line 8 of the 404 is:
 * `get_header(); ?>`
 * which has previously been opened with:
 * `<?php`
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/problems-with-404/#post-1390833)
 * > I changed my permalinks back to the default setting and it appears to load 
   > my homepage when any invalid addresses are quested
 * Yes it would look like your home page because you’re calling your header and 
   footer in the 404 file, but do you see a “Not found” or “Something you’re looking
   for is not here” message or similar (or whatever text you placed in your 404 
   template) when it shows the page?
 * > but when I go to
   > [http://www.partyeventsunlimited.co.uk/404.php](http://www.partyeventsunlimited.co.uk/404.php)
   > *error message etc..
   > > Well yes, calling a wordpress template file from a non-wordpress environment(
   > > ie. calling the file directly) it will mean the function are not recognised.
   > > You shouldn’t have the file in the root anyway, like i said before it should
   > > be in the theme folder..
   > >     ```
   > >     partyeventsunlimited.co.uk/404.php - wrong
   > >     partyeventsunlimited.co.uk/wp-content/themes/YOURTHEMENAME/404.php - correct
   > >     ```
   > > 
 *  Thread Starter [callbarney](https://wordpress.org/support/users/callbarney/)
 * (@callbarney)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/problems-with-404/#post-1390836)
 * No there is no “not found” as my homepage is quite different to my content pages(
   which is what the 404 page is replicated to look like). In the homepage there
   is no-side bar, on all other pages there is. So when I go to the 404 their should
   be a side bar, but there isnt.
 * So going to the address you said: [partyeventsunlimited.co.uk/PEU2/themes/YOURTHEMENAME/404.php](https://wordpress.org/support/topic/problems-with-404/partyeventsunlimited.co.uk/wp-content/themes/PEU2/404.php?output_format=md),
   I get
 *     ```
       Fatal error: Call to undefined function get_header() in /home/fhlinux142/p/partyeventsunlimited.co.uk/user/htdocs/wp-content/themes/PEU2/404.php on line 1
       ```
   
 * my current code is:
 *     ```
       <?php get_header(); ?>
          <div id="content" class="narrowcolumn">
            <h2 class="center">Error 404 - Not Found</h2>
       	</div>
       <?php get_sidebar(); ?>
       <?php get_footer(); ?>
       ```
   
 * hmmm, any idea?
 * _Btw, thank you for your help, I really really really do appreciate it._

Viewing 15 replies - 1 through 15 (of 26 total)

1 [2](https://wordpress.org/support/topic/problems-with-404/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/problems-with-404/page/2/?output_format=md)

The topic ‘Problems with 404’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 26 replies
 * 4 participants
 * Last reply from: [jamie33lee](https://wordpress.org/support/users/jamie33lee/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/problems-with-404/page/2/#post-1390878)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
