All Pages and Posts on WP 4.4.2 Multisite Network Began 404ing or Redirecting

Hello

Overnight, almost all pages and posts on all site on a WP 4.4.2 network began 404ing or redirecting to the home page of each site, so it seems to be a centralized issue.

The page and post urls that are 404ing are all valid and were working before this issue.

Two developers have been unable to sort it so far. Perhaps a WMPUDEV genius can. :slight_smile:

I granted support access through the WMPUDEV dashboard.

Wordfence security scan reports no issue, but it is suspicious that it occured overnight and we had granted a theme developer access to fix a theme issue.

Any assistance would be appreciated. ASAP.

Thanks,
Phil D

  • Adam Czajczyk

    Hello Phil!

    I hope you're well today and thank you for your question!

    I think it would be worth to know what exactly has been change/done on site. I wasn't even able access it via support access because I was instantly redirected to the front page. Furthermore, none of the pages give me 404 error but instead all of them push me back to the main site.

    It seems there's some redirect but I'm not yet sure where exactly is it located. Knowing what's been changed may be of help. However, I'd start with following steps:

    1. Re-setting/re-saving permalinks
    2. checking ".htaccess" file for your install

    If #1 doesn't help, could you please post content of .htaccess file here for me? I'd like to take a look at it and if there's nothing wrong there, I'll continue investigating it.

    Best regards,
    Adam

  • SooBahkDo

    Hello Adam,

    If I change the SETTINGS>>READING to static front page, then all page accesses will 404.

    However, when SETTINGS>READING is set to recent posts, then the main site behaves as you describe redirecting all page accesses to the home page. Other sites still present 404's

    http://festival.soobahkdo.org/agenda-2016/

    I changed the htaccess file to a minimum version shown below as a test without any change in the issue. The normal file also below has many more entries in it.

    ************************************
    MINIMUM HTACCESS

    # -PHP Memory Increase if not done in wp-config or php.ini
    # php_value memory_limit 756M

    # -FrontPage-
    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>

    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>

    AuthName soobahkdo.biz
    AuthUserFile /home/soobabiz/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/soobabiz/public_html/_vti_pvt/service.grp

    # -Per Network Setup-
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]

    *************************************************************

    NORMAL HTACCESS

    # -PHP Memory Increase if not done in wp-config or php.ini
    # php_value memory_limit 756M

    # BEGIN keep alive
    <IfModule mod_headers.c>
    Header set Connection keep-alive
    </IfModule>

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

    # - Added per WP Google Map Pro to allow display of markers on frontend
    <filesMatch "\.(xml)$">
    <ifModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
    </ifModule>
    </filesMatch>

    # Apply php5.ini settings to all directories
    # rather than only the directory the php.ini file is located in 2014-08-17
    <IfModule mod_suphp.c>
    suPHP_ConfigPath /home/soobahbiz/public_html/
    <Files php5.ini>
    Require all denied
    </Files>
    </IfModule>

    <Limit GET POST>
    Require all granted
    </Limit>

    <Limit PUT DELETE>
    Require all denied
    </Limit>

    AuthName soobahkdo.biz

    # -Per Network Setup-
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    # END WordPress

    # BEGIN Far Future Expiration Plugin
    <IfModule mod_expires.c>
    ExpiresActive on
    <FilesMatch "\.(gif|jpeg|jpg|png|ico|js|css|swf)$">
    ExpiresDefault "access plus 2160 hours"
    </FilesMatch>
    </IfModule>
    # END Far Future Expiration Plugin

    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType image/ico "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType text/html "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 1 month"
    </IfModule>
    ## EXPIRES CACHING ##

    ***********************************************************

    OTHER FINDINGS

    Error log in public_html

    [16-Apr-2016 07:14:15 America/Chicago] PHP Fatal error: Call to undefined function xhprof_enable() in /home/soobabiz/xhgui/external/header.php on line 40
    [16-Apr-2016 14:19:37 America/Chicago] PHP Parse error: syntax error, unexpected ''*F${UV/KvQc,cQ/e0TMAGwPMgKxa' (T_ENCAPSED_AND_WHITESPACE) in /home/soobabiz/public_html/wp-config.php on line 74

    **********************************

    I also changed the wp-config file to a know good earlier version without a change in the issue

    I removed EVERY PLUGIN from the entire network without a change in the issue

    I changed themes and tried TWENTY FIFTEEN without a change in the issue

  • SooBahkDo

    Problem Solved

    A core file had been modified as follows causing all the havoc and wasted time.

    The issue was traced back to wp-includes/query.php

    if ( !$post_status_obj->public && ! in_array( $status, $q_status ) ) {

    had been changed to:

    if ( !empty($post_status_obj->public) && ! in_array( $status, $q_status ) ) {

    Which while it doesn’t look like much it broke everything… $post_status_obj->public is a boolean and should only be true or false. The original (correct) line evaluates the if statement when public returns false, the “fix” checks that the variable isn’t empty so evaluates the if statement when public returns true instead.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.