[wp-trac] [WordPress Trac] #5705: Yearly Archive is Broken When
Custom Permalink Contains Page Slug
WordPress Trac
wp-trac at lists.automattic.com
Tue Jan 22 04:20:21 GMT 2008
#5705: Yearly Archive is Broken When Custom Permalink Contains Page Slug
---------------------+------------------------------------------------------
Reporter: fonetik | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.3.3
Component: General | Version: 2.3.2
Severity: normal | Keywords: rewrite, permalink, canonical, url
---------------------+------------------------------------------------------
If the index of a Wordpress blog is configured to show a page and the blog
loop then runs when another page is accessed, then it is natural to have
that page slug as the first entry in the permalink path.
In my specific case, "/" shows the "Main" page, so I created a "Blog" page
(whose slug is "blog") on which the normal blog posts loop runs. I have
custom permalinks which look like "/blog/year/month/day/post-slug".
Single entries, daily archives, and monthly archives can all be accessed
correctly, but yearly archives just show the blog front page (as if the
URL path was "/blog/" instead of "/blog/2006/".
The same issue results if the first directory in the permalink path is the
same as a normal page slug, though in that case the yearly archive URL
just shows that page.
I spent a lot of time looking through rewrite.php and it seems that the
issue could have something to do with the relaxed pagination rules which
allow "/blog/2/" to reference the second page of paginated posts instead
of the canonical "/blog/page/2/" although it could also be a problem with
the URL being matched by the relaxed attachments rules which allow "/page
/attachment-name/" instead of the "/page/attachment/attachment-name/".
More generally, it seems that there are a lot of overly general URLs
accepted by the rewrite. The new canonical URL stuff in 2.3 is great, but
it seems strange that there is code to reduce the number of URLs in
canonical.php when there is extra code in rewrite.php that only exists to
create multiple URLs which point to the same thing (pagination,
attachments, and feeds seem to be the worst offenders).
--
Ticket URL: <http://trac.wordpress.org/ticket/5705>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list