[wp-trac] [WordPress Trac] #7101: Canonical rewrite misses some category URLs

WordPress Trac wp-trac at lists.automattic.com
Thu Jun 5 14:57:02 GMT 2008


#7101: Canonical rewrite misses some category URLs
----------------------+-----------------------------------------------------
 Reporter:  jhodgdon  |       Owner:  anonymous        
     Type:  defect    |      Status:  new              
 Priority:  normal    |   Milestone:  2.6              
Component:  General   |     Version:  2.5.1            
 Severity:  normal    |    Keywords:  canonical rewrite
----------------------+-----------------------------------------------------
 My understanding of the canonical rewrite functionality in WordPress is
 that it should rewrite all URLs to their canonical form. For instance, it
 will take
    [blog home]/?cat=[ID]
 and redirect you to
    [blog home]/category/[cat slug]
 (assuming you have permalinks, and "category" is your category base)

 But this is not working for all legal category URLs, at least under some
 permalink structures. To reproduce:

 a) Set your permalink structure to /%category%/%postname%/

 b) Type in a URL
     [blog home]/[cat slug]
 You will find this takes you to the category page for that category, but
 the URL is not rewritten to its canonical form, which should be
     [blog home]/category/[cat slug]

 The reason this lack of rewriting is a problem is that the pagination URLs
 on this page are incorrect -- they lead to 404 errors -- see #5331

 Note that the category URLs generated by functions such as
 wp_list_categories or whatever are in the correct form, but if someone
 visits a single-post page and then removes the post slug at the end of the
 URL, they will get to the incorrect category page. Its URL should be
 canonically rewritten, but it isn't.

 This was tested in the 2.5.1 release.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7101>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list