Make WordPress Core

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's profile 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)

#1 @aesqe
16 years ago

  • Keywords rewrite permalinks slug added
  • Version changed from 2.6 to 2.6.1

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

$query == category_name=uncategorized&name=test&page=/123

uncategorized/123 = OK

$query == category_name=uncategorized&name=123&page=

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?

#2 @ryan
16 years ago

  • Component changed from General to Permalinks
  • Owner anonymous deleted

#3 @markjaquith
16 years ago

I DO NOT encounter this in current trunk with "Month and Name" permalinks.

I DO encounter it in current trunk with /%category%/%postname%/ when set to a child category.

#4 @markjaquith
16 years ago

  • Milestone changed from 2.7 to 2.9

#5 @mrmist
16 years ago

  • Milestone 2.9 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

I think this is a duplicate of #5305

Note: See TracTickets for help on using tickets.