WordPress.org

Ready to get started?Download WordPress

Forums

404 pages not working? (13 posts)

  1. leeppp222
    Member
    Posted 5 years ago #

    I have only today noticed that on my blog http://www.thecvstore.net/blog/ if you try to load a page that doesn't exist, instead of showing a normal 404 error, I get a strange result - a bit of text from my footer shows and that is it!

    What can be wrong?!

  2. leeppp222
    Member
    Posted 5 years ago #

    I have made a couple of changes and now, instead of showing part of my footer i get a page can't be displayed error - still no 404!?!?!?

  3. leeppp222
    Member
    Posted 5 years ago #

    as another update - if i remove the htaccess file that comes as standard with WordPress the 404 header works but obviously I need the htaccess file back for my posts to load etc?!?

    The permalink structire I use is /%postname%/

    Has anyone got any ideas?

  4. leeppp222
    Member
    Posted 5 years ago #

    To give people some more information:

    Permalink structure set within WordPress admin panel is: /%postname%/

    htaccess file looks like:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>

    # END WordPress

    When I remove the htaccess file, the 404 works as it should but obviously my blog links do not work...

    When I put the htaccess file back, all links are fine but when you type in a page that doesn't exist, I just get a blank page (no 404 header or anything as I should).

    Would love to hear from someone who can help.

  5. iridiax
    Member
    Posted 5 years ago #

    The permalink structire I use is /%postname%/

    Do not use just /%postname%/ as your permalink structure, it will only cause you problems.

  6. leeppp222
    Member
    Posted 5 years ago #

    iridiax,

    I have been using this structure for a long time - what can I do now - I have 100+ pages all indexed in Google using this structure!?

  7. leeppp222
    Member
    Posted 5 years ago #

    *BUMP*

  8. moshu
    Member
    Posted 5 years ago #

    1. WordPress doesn't come wiht any kind of .htaccess file.
    2. You created it when you wanted to use "nice" permalinks.
    3. Create a 404.php file in your theme's folder and put into it whatever you want. It will be shown when wrong address is typed.

    STOP posting the same in ten topics! (I am fast with the delete button)

  9. leeppp222
    Member
    Posted 5 years ago #

    moshu - i haven't posted 10 topics - there was only this and 1 about changing the post structure which isn't the same topic.

    with regards to creating a 404.php - there is one there but it just doesn't seem to work unless I stop using the htaccess file.

  10. moshu
    Member
    Posted 5 years ago #

    (Let's not argue about the number of topics I had to delete...)

    Your permalinks work at this address: http://www.thecvstore.net/blog/

    As for 404 - did you try to take a look how it is done in the default theme and use the same code/stuff?

  11. leeppp222
    Member
    Posted 5 years ago #

    if you had to delete 10 posts then there is something wrong as I can promise there should only have been 2...anyway...

    It's not the permalinks I have a problem with? I have a problem with pages that don't exist not delivering a 404 status like they're supposed to. I tried changing my theme to the default wp one and it still doesn't work.

  12. Doktor Lizard
    Member
    Posted 5 years ago #

    Did you leave in the whole
    <?php if (have_posts()) : ?>
    bit of code in your 404 template?

    I was getting a blank 404 result on one of my templates and then I thought to remove all of those related snippets, removed the related
    <?php endif; ?>
    tags, the page navigation bits and voila!

    My 404 results now show the intended information and layout without any
    problems. No messing with my .htaccess file, no messing with my permalinks etc. Simply discovered my blunder of leaving in the post query in the 404 template - maybe you copied that stuff in there by accident, too?

  13. jentorme
    Member
    Posted 5 years ago #

    Did you ever solve your problem?

    I'm having basically the same problem. I use "/%postname%/" too, and it's worked well for everything except this.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags