404 error on some pages.

I’m having a random 404 problem. I have a WPMU setup running for years now and now I have some pages giving me 404 errors on my main site, not all pages just some, like all blogs (blog page), about page, and help page.

I already tried to deactivate plugins, re-save permalinks, change back to standard htaccess, checked with the default theme and still no luck. Please help.

  • Patrick Freitas
    • Staff

    Hi Dutchman

    Hope you are going well :smiley:

    I had a closer look at your problem, and I renamed the .htaccess file to .htaccess-old, then I went to Permalinks > Custom Permalinks > Save to recreate the permalinks structure but didn’t work, I double checked the new .htaccess fine generated from permalinks, then I realized that it wasn’t generating the new file.

    So I created a new one manually and pasted the default WordPress rules:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [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)$ wp/$1 [L]
    RewriteRule . index.php [L]

    It solved the problem, after that, I completed the new file using the Defender and Humminbird rules, now you can access the pages. I kept the .htaccess-old at the server, in case you need any other rule from there.

    Best Regards,

    Patrick Freitas

  • Patrick Freitas
    • Staff

    Hi Dutchman

    It seems the PHP rule was causing this,

    I updated the rule to

    # Define PHP 7.1
    AddHandler application/x-httpd-php71 .php

    Instead

    AddHandler application/x-httpd-php71 .php .php5 .php4 .php3

    Then I cleaned all caches using the SG Optimize plugin, and the website is back, however, I’m wondering about the SG Optimize plugin, I see you are using Hummingbird, try to deactivate the SG Optimize plugin, then enable the caches modules, and Gzip modules from Hummingbird.

    Let me know if you need any further help at this issue.

    Best Regards,

    Patrick Freitas

  • Dutchman
    • The Bug Hunter

    Patrick Freitas

    Thanks for the update, but it seems that broke just all my subsites.

    I had to put back the old rules for my entire network to work properly.

    Even the loading time was over 43 seconds.

    Any other solutions we could try?

    Network is working properly, just not the main site. some pages get 404… not all.

    PS

    I had a weird issue in the past. There was a moment that my subsites were displaying with /blog/subsitename. I had no idea where the /blog came from, but I removed it via phpmyadmin and in Network admin/site settings and re-saved it. I also removed the blog.dir via cpanel.

    Could that be something?

    Cheers,

    Ronald

  • Dutchman
    • The Bug Hunter

    Hi Patrick Freitas

    Sorry for the late reply, I have been trying a sorts of suggested solutions that was available online. Unfortunately none of them work, only temporarily.

    Non buddypress and bbpress pages are giving the 404 errors after a while. When I save the permalinks settings, everything will work fine…. temporarily. few hours later or few days later, it gives a 404 error. Not doing any changes.

    Disabling plugins and back to default themes, work sometimes…. again temporarily.

    It’s really annoying trying to get the source of all this, because its all on a live network.

    Any suggestions are welcome.

    Pages that causes the 404’s:

    https://www.cu2.nz/privacy-policy/

    https://www.cu2.nz/terms-of-service/

    https://www.cu2.nz/desc/

    Just a few to test, basically everything else that is not a buddpress page or bbpress.

    Cheers,

    Ronald

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.