Question

I've got a WordPress CPT that I've had running for a couple weeks. There weren't any problems with it.

In the last couple days, it's been going haywire. Every few minutes, WordPress forgets that the page exists and returns a 404 error. This can be fixed by flushing the permalink rules in the admin panel, but a few minutes later the same things happens and it has to be fixed again.

Does anyone know what could be causing this, or how to fix it?

Errors: Some of these:

[Fri Sep 24 04:11:17 2010] [error] [client 150.254.160.253] Invalid method in request \\n\\n

More of these (tv2 is the slug for the CPT):

[Fri Sep 24 03:25:15 2010] [error] [client 67.142.166.25] File does not exist: /var/www/vhosts/default/htdocs/tv2

And a ton of these:

[Fri Sep 24 03:58:36 2010] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
Was it helpful?

Solution

I do not know the specific path layout on your webserver, but the entries from the error log do not look to me that it is specifically wordpress related:

Invalid method in request \\n\\n

This error is caused by an invalid HTTP request. Each HTTP request has a method. Most certainly it was missing in the request that resulted in the log entry.

File does not exist: /var/www/vhosts/default/htdocs/tv2

A File does not exists message isn't normally created when a PHP script returns 404 response headers. So most certainly, this error was not reported by Wordpress but by the server itself. Probably the mod_rewrite configuration for your wordpress blog was unavailable.

Directory index forbidden by Options directive: /var/www/html/

This looks the same to me. If /var/www/html/ is the webroot of your blog, then this shows that index.php has not been found or wasn't looked for as directory index by your webserver.


So in the end this looks very much like a webserver configuration issue to me. Permanently rebuilding permalinks wouldn't help here either then. If you are unsure, you can make use of the Permafrost (Wordpress Plugin). A related question regaring 404 errors and permalinks is: single-type.php not working, delivering 404.

OTHER TIPS

My first instinct is that a plugin might be to blame. Many plugins that touch the WordPress rewrite engine will flush the rewrite rules whenever they're used rather than when they're first activated (which is what they're supposed to do).

So I'd double check your plugins and see if any of them are touching the rewriter or calling flush_rewrite_rules() and, if so, deactivate them and see if that solves the problem. If you have to live without a feature for a day or two to diagnose the problem, I'd say that's worth it.

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top