Permalinks won’t function without mod_rewrite. See this guide for alternatives:
http://codex.wordpress.org/Using_Permalinks#Permalinks_without_mod_rewrite
Hi,I got the same error with no posts in the post list page.
I installed URL rewrite .but the error is still exist.
Could you give me more hint.
Thanks
Stanley
Thanks macmanx, but I’m not sure whether this is the problem. We’re using the ISAPI rewrite module and permalinks on the front end are working perfectly. The only problem is the 404 generated in the admin area, specifically when there are no items for a particular type. This wasn’t happening prior to WordPress 3 with the same server setup.
Sorry if I’m missing something, I could believe it was some peculiarity of the way ISAPI rewrite works that only affects this section. Just want to make sure there’s nothing I can do with the existing setup first.
OK, not sure of the drawbacks of this fix so far, but on line 477 of /wp-includes/classes.php (the handle404 function) is the following:
if ( ( 0 == count( $wp_query->posts ) ) && !is_404() && !is_robots() && !is_search() && !is_home() ) {
in previous versions the line was
if ( ( 0 == count( $wp_query->posts ) ) && !is_404() && !is_robots() && !is_search() && !is_home() && ( $this->did_permalink || (!empty($_SERVER['QUERY_STRING']) && (false === strpos($_SERVER['REQUEST_URI'], '?'))) ) ) {
If this is rolled back to the pre-wordpress 3 version then empty listing pages are displayed correctly. Will look into it further, but a little too busy to delve right now.
Thanks for your help guys!
Gav
Thanks for the solution, Dellbridge. Your code swap worked for me.
Here was my situation. I added a few new Post Types. I was getting the 404 error when trying to see the list in the Admin (edit.php?post_type=myposttype) when there were no posts. It should just show a normal page with no posts, and a message saying no posts found, or whatever you specified in register_post_type label ‘not_found’ value.
The really strange thing is that when I viewed the page with the web browser on the server itself it worked just fine, no 404. For the record I’m using WP 3 on iis7, and the rewrite rules generated by wordpress in the config file. So it seems that it’s something to do with the rewrites, permissions and this line of code, but I am at a loss as to what it is.
Definitely something to fix for the next version. I really didn’t want to have to tell the client to ignore the 404 and to just add a post to make it go away, very tacky.
Thank you Dellbridge.
I was pulling my hair out with this one. I began moving our WordPress sites from Apache on Ubuntu to Windows 2008 IIS7 the other day. I did not get this issue on Apache but your code swapped resolved the problem on IIS7.