Opened 16 years ago
Closed 16 years ago
#7355 closed defect (bug) (duplicate)
"next post" 404s when permalinks are set to "month and name" and a post has no name
Reported by: | mrmist | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.6.1 |
Component: | Permalinks | Keywords: | 404, rewrite, permalinks, slug |
Focuses: | Cc: |
Description
If I have permalinks set to "Month and Name" then I create a post with no name, then go to post level view on my site, whenever the "next post" or "previous post" is pointing to the post with no name it will generate a 404 error.
The URL it generates for posts-with-no-name is
http://www.example.com/blog/2008/07/19/33/
Where 33 is the post number.
Possibly for posts with no name a random slug needs to be generated or something?
Only month + name permalink structure seems to give this behaviour.
Change History (5)
Note: See
TracTickets for help on using
tickets.
You will also get an 404 if a post is assigned to a child category and the slug contains numbers only.
Trying to access it via lowest parent category will work, but nothing else.
Permalink structure: /%category%/%postname%/
Example:
post slug: "123"
posted in: "test" (a child category of "uncategorized" - category "uncategorized" is left unchecked)
uncategorized/test/123 = 404
uncategorized/123 = OK
Obviously, it searches for page number 123 in the first case.
Tested on 2.6.1, clean install, no plugins.
IMHO, the rewrite rules don't necessarily need to be rewritten, but maybe some form of "checking" should be added.
In this case, if page number 123 of post which has a slug 'test' and resides in category 'uncategorized' yields a 404, why not try if post with slug '123' exists in category 'test'? Why isn't there a "/page/" before the number anyway?