Support » Fixing WordPress » Secondary, or Child Pages returning a 404 error after WP 3.4 update

  • Hi all,
    I have a problem, I think that it might be permalinks related, but I’m unsure. All of my sub-pages (child pages, secondary pages) return a 404 error when using the Posts permalinks structure. They work OK when I use the default permalinks structure, they also work OK when they are move out from “under” the parent pages and are made a “main page.”

    The site is on a linux server (GoDaddy), so I’m not sure if it’s related to a similar issue with the IIS servers. I also don’t think that it is just theme related, as I get similar errors with a default theme.I’m not using any plugins that affect permalinks.

    Some of the main pages (created after the update) had a similar issue, but it was fixed by switching to the default permalinks, and then switching back to the Posts permalinks.

    Just a note: I can’t seem to recreate this issue on another server.

    Is this a little bug in the new update, or is it just me? Any ideas on how to fix this?

    Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • You’ve probably moved on by now, but I found a way to fix this. I must admit I’m a novice at coding. I don’t know why or how this worked, but it did.

    The same thing happened to me all of a sudden. My all my child pages started returning 404 error pages (newly created ones and old).

    After searching, I think that it may have been because I changed my permalink structure from /%category%/%postname%/ to /%postname%/. From what I read it seems that just changing the permalinks in general can cause this kind of problem for some reason. I reset the permalinks to the default setting and the problem went away, but obviously that’s not a solution. I also changed the permissions to 666 on my .htaccess file after restoring it from a back up, and that did nothing.

    First
    Try re-saving your permalinks (this didn’t work for me, but it worked for others)

    Second
    Try resetting your permalinks to the default setting and then changing them back to your settings (this didn’t work for me, but it worked for others)

    Third – (this worked for me)

    paste this:
    global $wp_rewrite; $wp_rewrite->flush_rules();

    into your themes functions.php, refresh your website, then delete the code.

    That is what fixed all my child pages.

    I got that from here:

    http://wordpress.stackexchange.com/questions/5858/category-links-suddenly-started-giving-404-errors

    Just updated one of the website I’m working on to WP 3.5.1 and encountered this problem. Thanks, AlyseS, for the simple fix!

    I got it to work by changing everything back to DEFAULT.

    But, that isn’t ‘pretty’.

    When I tried to change it to any other setting, I got the 404 Error.

    So I’d like to try option #3,

    Can you please tell me WHERE in the themes functions.php I would paste the code you have?

    Thanks in advance for the help!

    I’m having the same problem!:( but I found the solution . my server :Centos 5.7 ,apache 2.4. permalink structure used rewrite_module in apache.rewrite rules into .htaccess . but it didn’t work for me. Check httpd.conf , “AllowOverride None” It defaults to None,change to ALL.Then that’s ok! 🙂

    very Sorry about my bad english!!!

    @motophotonmg – if you didn’t figure this out yet you can input that line just BEFORE the closing ?> at the end of the functions.php file unless you are using a child theme or other plugin to override the loop.

    And thank you Alyse for the solution that FINALLY worked for my client site! Worked perfectly! 😀

    cry5tal985

    (@cry5tal985)

    I’ve tried all of the options and they’re still not loading. 🙁 They will only load if I set it to default but that looks terrible and is horrible for SEO. I’ve even tried deactivating all my plugins!

    Paulibee

    (@paulibee)

    @katmoody, I was wondering if you can help me. I wanted to follow step 3, but under function.php for my theme I can’t find a closing ?>php to insert the code… Am I missing something important in the process? This is how the code looks right now:
    <?php
    /**
    * Theme Functions
    *
    * DO NOT EDIT THIS FILE. THE SKY WILL FALL.
    *
    * Any custom functions should be added to your child theme’s
    * functions.php file. This will prevent losing your changes
    * during a theme upgrade.
    *
    * @author TrueThemes
    * @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
    */

    /**
    * Load the theme textdomain for localizing strings.
    */
    load_theme_textdomain( ‘tt_theme_framework’, dirname( __FILE__ ) . ‘/languages/’ );

    /**
    * Ensure that error reporting is turned on if WP_DEBUG is set to true.
    */
    if ( defined( ‘WP_DEBUG’ ) && WP_DEBUG ) {
    $error_setting = ini_get( ‘display_errors’ );
    if ( ‘0’ == $error_setting )
    ini_set( ‘display_errors’, ‘1’ );
    }

    /**
    * Ensure that error reporting is turned on.
    */
    $php_error_setting = ini_get( ‘display_errors’ );
    if ( ‘1’ == $php_error_setting )
    error_reporting( E_ALL & ~E_STRICT & ~E_NOTICE & ~E_WARNING & ~E_DEPRECATED & ~E_USER_NOTICE );

    /**
    * Load the TrueThemes framework.
    */
    require_once( dirname( __FILE__ ) . ‘/framework/framework_init.php’ );

    Thanks AlyseS, #3 worked great 😀
    It was almost magical. Everything worked afterward. Rainbows sparkled and flowers blossomed and puppies were born.
    Thank you so much! 😀

    AlyseS, thank you thank you! I can’t tell you how grateful I am for that fix.
    I’d made a WordPress site on a local WAMP server using pretty permalinks (which required a bit of configuration to get working) and used BackupBuddy to port it to Godaddy’s servers.
    The home page was fine and the backup appeared to have installed everything else, but every page except the index was 404.
    The line of code you suggested fixed everything immediately.
    Thanks again 🙂

    @paulibee – I’m sorry I missed your question before.

    Your first thing is that you need to put together a custom functions file as part of a child theme if you haven’t already.

    Then try this trick – hit enter after the “add code after this” section and put your line of code there so you don’t interfere with the other code. You won’t always have a closing php code there (I’m not a PHP expert but it’s my understanding that you don’t have to have this as long as the PHP is closed within the code elsewhere…again just search on it if unsure as I’m not a PHP guru – I know only enough to play with it!)

    If unsure about putting a child theme together – look in the WordPress codex and you should find enough info to help you put a basic one together!

    Hope that helps and sorry again I saw this so late!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Secondary, or Child Pages returning a 404 error after WP 3.4 update’ is closed to new replies.