Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#29997 closed defect (bug) (invalid)

Custom permalink free text same of category base

Reported by: murphz's profile Murphz Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0
Component: Permalinks Keywords:
Focuses: Cc:


I'm using "/blog/%category%/%postname%" as custom permalink for posts.

I've noticed that if I use blog as the categories base text, all the posts will get a 404 error. If I change "blog" in categories base text, everything's ok.

I wanted to use /blog for posts and for categories too, something like:

But It's not possible to have the same initial text (if a different one is used, everything's fine) as it raise the 404 error for all posts.

Hope its clear..


Change History (1)

#1 @DrewAPicture
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Hi Murphz, thanks for the report and welcome to Trac :)

I can confirm the same behavior, though this is not a bug. The reason you're getting 404s on posts when using 'blog' as the category base in addition to the custom permastruct, is that the rewrite is matching for categories over posts.

In other words, you get a 404 for this:

and a category archive listing for this:

It's possible to handle multiple routing like this through the same rewrite endpoint, but it requires filtering rewrites and definitely falls outside the scope of what core will handle for you.

Note: See TracTickets for help on using tickets.