• Hi All,

    My website is 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 and see for yourself…

    I have tried ammending the .htaccess file with no luck so hopefully someone can help me solve this

Viewing 11 replies - 16 through 26 (of 26 total)
  • So going to the address you said: partyeventsunlimited.co.uk/PEU2/themes/YOURTHEMENAME/404.php, I get

    Yes that will happen, you’re not suppose to call these files directly, the only requirements for that 404.php file to operate, as far as WordPress is concerned.. are..

    1. That the file exists at (example.com/wp-content/name-of-whatever-theme-you-use/404.php
    2. Above said file contains WordPress valid code (what you’ve posted above is perfectly fine code wise)

    You do not need to call the file, you should be sent to a 404 url automatically if WordPress deterimes a URL to be invalid, this should be automatic…

    This is an invalid URL.
    http://partyeventsunlimited.co.uk/897gt387g12131

    Yet when querying for that page it’s clearly not loading the 404 template. Look at the code(don’t worry for the moment that it’s just text), which file is that coming from? (Look at the code and identify that with whatever theme(or non-theme) file contains that code)

    EDIT:: Can you provide the code from the following two files please, i have a theory about the problem. Two files from your theme, header.php, and functions.php..

    Please copy the code from the files, and place each into seperate pastebinshttp://wordpress.pastebin.ca/
    Then report the links back here please.

    Thread Starter callbarney

    (@callbarney)

    OK…

    Header is: http://wordpress.pastebin.ca/1817394

    Functions is: http://wordpress.pastebin.ca/1817400

    Let me know what your thinking

    If you remove this line from the header file, does the error page behave any differently?

    <?php include("login.php"); ?>

    Thread Starter callbarney

    (@callbarney)

    nope still loads as plain text just without the log in code

    Where does this code come from then, because i can’t see it in your header or functions file..

    ption value=1990>1990<option value=1991>1991<option value=1992>1992<option value=1993>1993<option value=1994>1994<option value=1995>1995<option value=1996>1996<option value=1997>1997<option value=1998>1998<option value=1999>1999<option value=2000>2000<option value=2001>2001<option value=2002>2002<option value=2003>2003<option value=2004>2004<option value=2005>2005
    
    .etc....

    Whatever file is generating that piece of code seems to be where the code starts to have problems..

    Thread Starter callbarney

    (@callbarney)

    That is from login.php… when I removed the include login.php it didnt have that part of the code in, it had plain text code from further down the page… imply that its ignoring a certain ammount of characters at the start of the compiled page

    Ok try something new..

    Remove this line from the header and see if it helps.

    <?php wp_head(); ?>

    If not, then i have to ask, do you have any custom htaccess rules setup relating to content/mime types?

    Thread Starter callbarney

    (@callbarney)

    page loads blank – Also tried added in <html><body> tages just to make sure but still nothing…

    and no my htaccess is still the same

    # 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

    Ok, and what happens when you don’t have a 404 file? What comes up?

    Thread Starter callbarney

    (@callbarney)

    it looks like the text only version of my homepage

    on value=1977>1977<option value=1978>1978<option value=1979>1979<option value=1980>1980<option value=1981>1981<option value=1982>1982<option value=1983>1983<option value=1984>1984<option value=1985>1985<option value=1986>1986<option value=1987>1987<option value=1988>1988<option value=1989>1989<option value=1990>1990<option value=1991>1991<option value=1992>1992<option value=1993>1993<option value=1994>1994<option value=1995>1995<option value=1996>1996<option value=1997>1997<option value=1998>1998<option value=1999>1999<option value=2000>2000<option value=2001>2001<option value=2002>2002<option value=2003>2003<option value=2004>2004<option …..

    I’ve just checked the plain text page, when a 404 is installed, it would also appear to be my homepage

    jamie33lee

    (@jamie33lee)

    callbarney – your website appears to handle 404 errors correctly now, could you explain how you did this please?

Viewing 11 replies - 16 through 26 (of 26 total)

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