Make WordPress Core

Opened 14 years ago

Last modified 5 years ago

#11931 reopened enhancement

Day/Month/Year Permalink Structure Fails in Archives

Reported by: frenzie's profile Frenzie Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8.6
Component: Rewrite Rules Keywords:
Focuses: Cc:

Description (last modified by danielbachhuber)

If you use a permalink structure with %day%/%monthnum%/%year% then the archives automatically become date/%day%/%monthnum%/%year%. WordPress automatically makes the links to monthly archives date/01/2010 etc (which is good), but if you go to it you get a 404 not found.

Reproduce using for example /%post_id%/%postname%/%day%/%monthnum%/%year%/

I "fixed" it with this plugin I wrote, but it will probably fail when things like /page/2/ come into play (that wasn't really important yet).

Attachments (5)

rewrite-day-month-year.php (1.7 KB) - added by Frenzie 14 years ago.
2019-04-05 at 8.40 AM.jpeg (272.6 KB) - added by danielbachhuber 5 years ago.
2019-04-05 at 8.41 AM.jpeg (251.8 KB) - added by danielbachhuber 5 years ago.
Screenshot_2019-04-05_18-31-28.png (179.9 KB) - added by frenziefrenz 5 years ago.
Screenshot_2019-04-05_18-32-11.png (140.8 KB) - added by frenziefrenz 5 years ago.

Download all attachments as: .zip

Change History (12)

#1 @nacin
14 years ago

  • Keywords needs-patch added; permalink day/month/year removed
  • Milestone changed from Unassigned to Future Release
  • Type changed from defect (bug) to enhancement

#2 @ryan
10 years ago

  • Owner ryan deleted
  • Status changed from new to assigned

#3 @chriscct7
8 years ago

  • Keywords needs-testing added

#4 @danielbachhuber
5 years ago

  • Description modified (diff)
  • Keywords needs-patch needs-testing removed
  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from assigned to closed

I tried and was unable to reproduce this issue in WordPress 5.2

When I set my permalink structure to /%post_id%/%postname%/%day%/%monthnum%/%year%/, my blog post loaded as expected at http://wordpress-develop.test/1/testing-a-new-draft/05/04/2019 and I was able to access a date archive at http://wordpress-develop.test/date/05/04/2019 as expected.

Feel free to re-open if there are other steps that reproduce this issue.

#5 @frenziefrenz
5 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

There are no other steps than those in the OP.

#6 @danielbachhuber
5 years ago

@frenziefrenz Can you share the permalink structure you're using?

#7 @frenziefrenz
5 years ago

@danielbachhuber The one from the OP, /%post_id%/%postname%/%day%/%monthnum%/%year%/. But the specifics don't matter much as long as it includes something like %monthnum%/%year%/, %day%/%monthnum%/%year%/, etc.

  • The structure that wasn't mentioned in the OP works: http://172.17.0.3/date/05/04/2019/.
  • http://172.17.0.3/date/04/2019/ is the default front page monthly archives link, which doesn't work.
  • I don't think http://172.17.0.3/date/2019/ is directly accessible through the default theme, but in any case it also doesn't work when it should.

The workaround I attached a decade ago is still functional and it might even be borderline generic.

Note: See TracTickets for help on using tickets.