[wp-trac] [WordPress Trac] #11192: WP_Rewrite causes 404 errors
WordPress Trac
wp-trac at lists.automattic.com
Thu Nov 19 21:57:14 UTC 2009
#11192: WP_Rewrite causes 404 errors
----------------------------+-----------------------------------------------
Reporter: PrograMedia | Owner: ryan
Type: task (blessed) | Status: new
Priority: normal | Milestone: Unassigned
Component: Rewrite Rules | Version: 2.8.5
Severity: normal | Keywords: 404 rewrite
----------------------------+-----------------------------------------------
the quick and dirty example at
[http://codex.wordpress.org/Function_Reference/WP_Rewrite] caused 404
errors with my custom redirects. After a lot debugging I found in classes
the function handle_404().
There is a check when there are '''no posts''' it generates always 404:
{{{
if ( (0 == count($wp_query->posts)) && !is_404() && ...
}}}
As I had no posts I always had 404 in my pages. Just adding a dummy post
solved my problem.
My suggestion is to check if there are '''no posts''', ''to check also''
if there are '''custom rules''' before generating 404.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11192>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list