WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Insane 404 problem (15 posts)

  1. johnny_n
    Member
    Posted 1 year ago #

    I'm running WP multisite (and an old WPMU blog). I'm using the domain mapping plugin to map blog 2 to a new domain. After moving to a new VPS host (this is one of many WP sites on the VPS, the rest are fine but this is the only multisite), I'm getting random 404 errors on posts (the 404 errors are consistent, the posts that this happens to seem random - some new, some old).

    Deactivating plugins doesn't fix.
    Changing themes doesn't fix.
    "ugly" permalinks and number permalinks work - nothing else does.
    .htaccess looks ok (see below)
    AllowOverride All is in my .httpd.conf
    When I rename my .htaccess file, a new one is not generated.
    .htaccess permissions are 644
    WP 3.5
    PHP 5.3

    I've spent hours on this - I'm pretty familiar with WordPress, but this really has me stumped.

    Options FollowSymlinks
    
    # BEGIN WordPress
    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]
    
    # END WordPress
    
    #BEGIN Image Upload HTTP Error Fix
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>
    <IfModule security_module>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>
    <IfModule security2_module>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>
    #END Image Upload HTTP Error Fix

    I did look in the domain mapping setup and blog 2 is checked as primary, I'm not sure if that could be effecting it, temporarily blog 1 is replaced with another site but that never caused problems before and when that site is taken down and replaced with blog 1, it doesn't fix the issue. Blog 1 has no 404 errors when up.

    Thanks for any ideas, this is driving me nuts...

  2. Do non-mapped subdomains work?

    That is foo.domain.com vs mappedomain.com?

  3. johnny_n
    Member
    Posted 1 year ago #

    Wow, that is interesting. It's a clue.

    None of these blogs have tons of posts, but in blog 3, no posts work from 2012 at all (maybe 10 of them). Ones previous (maybe 35) do work - at least the dozen or so I tried.

    Blog 4 works fine, though it has nothing from 2012 and very few posts in general - I did try to change the post date on one post to 2012 and it continued to work fine.

    Blog 5, just set up, only has one post and it doesn't work.

    I'm still at a loss but that is very good thinking... a

  4. Buh? O.O

    Is there anything in your PHP error log?

  5. johnny_n
    Member
    Posted 1 year ago #

    No... nothing related to this (in the root folder there's some Shopp plug-in related stuff but not a big deal). I should have mentioned that - I had been through the logs in the root folder, the theme folder and the plug-in folder and found nothing. I just double-checked again and same story. Nothing.

  6. Are you using a lot of custom post types or taxonomies? All I can think is that one of them is clashing.

  7. johnny_n
    Member
    Posted 1 year ago #

    Humm.... I'll look into it. Definitely not a lot of them, but it's possible we're using some.

    I'm going to be making some sweeping changes to the whole site, I wanted to get this ironed out first but it just might be that the changes will fix it (though it's also possible that'll make them worse).

    I suppose we'll see... I'll report back if I learn anything, thanks for your help!

  8. s2ceball
    Member
    Posted 1 year ago #

    I'm having the same problem, both before and after installing the Mapping Domain plug-in: 404s on all page/posts at the root domain (ceball.com) and the (first of many to-be-created) subdomain, jobs.ceball.com. Everything's fine when I switch from pretty to ugly permalinks, but I *need* to use pretty permalinks. So I'll be watching this thread, thanks.

  9. Did either of you happen to do any tests on pretty permalinks before you turned on Multisite?

  10. johnny_n
    Member
    Posted 1 year ago #

    It's been so long ago I couldn't tell you - my site was built in 2008, and we had pretty permalinks since the beginning - and almost from the beginning (maybe 1 month later) it became a WPMU site. We switched to multisite shortly after 3.0 was released. But everything was working fine across that transition and for literally a year+ longer.

    I'm 90% sure my problems started after I switched hosts maybe two months ago - I'm going to send them a link to this thread and see if they have any ideas server-side. I checked my httpd.confs, and obviously the .htaccess files, but there might be something else I'm not seeing. The server did have PHP 5.3 installed, which threw the site for a loop (on the main site we're talking about (#2), it broke the posts appearing in the admin), but I thought I had that ironed out pretty quickly (bad plugin) and didn't immediately notice this problem after that.

    Anyway, this is my next path of inquiry. I think the other strange thing is the .htaccess file isn't regenerated when I delete or move it. So I want to look into that too.

  11. s2ceball
    Member
    Posted 1 year ago #

    I was running 20 sites with permalinks before I switched to multisite, and they were all working fine. I had a friend more techie than myself helping me last night. There were problems with the htaccess file and with the way I had set up the MU site install (accidentally - d'oh! -- setting it to http://www.domain). We scratched everything and reinstalled (since I had all the backups) and ditched using the Domain Mapping plug-in, which just seemed to cause more trouble than it was worth and doesn't seem to be needed with my host), and everything is working fine now. So, human error and over-reliance on old instructions. THanks for this post, as it helped me figure out a starting point.

  12. johnny_n
    Member
    Posted 1 year ago #

    Thanks @s2ceball -- I was thinking about loosing the domain mapping plugin as well... now that you're saying it was causing you problems, that's going to be the next thing I try.

    Thank you!

  13. Domain mapping ... shouldn't. I mean, if it's not in place for that subdomain, it does nothing. I use it, essentially so does wordpress.com

  14. johnny_n
    Member
    Posted 1 year ago #

    I definitely trust Donncha - but my thinking is it's just another layer in the troubleshooting process. My hosts had an idea, I will report back once I've followed it.

  15. johnny_n
    Member
    Posted 1 year ago #

    Ok, problem is solved - nothing to do with WordPress at all, my hosts were correct. It's actually a very simple solution (and I might be a bit dense to not have realized it sooner) but I had overlooked it as I had misunderstood the way in which the server (and WordPress) processes requests.

    Short answer: if you are experiencing seemingly bizarre (or yes, even insane) 404's, check your directory structure to see if it in any way parallels the WordPress install. In other words, I had a /2013/ directory, and a /2012/ directory for other reasons (both created not long before the server migration), which was throwing off the "pretty" permalinks because the server was assuming those were real files in those real directories.

    It didn't affect all files which is the strange part, but this is definitely the cause of my problems. Renaming those folders fixes it.

Topic Closed

This topic has been closed to new replies.

About this Topic