Post 404 errors due to a base post's name matching the Permalink option "category base"
|Reported by:||sniper231||Owned by:|
When the "category base" option under Settings>Permalinks is set as a value, one can still create a post with the same value used as the new post's name and thus its permalink path. Thus, when a user tries to navigate to the post via its permalink, Wordpress thinks the user wants to access a category and gives a 404 error.
Here's an example.
Say I set my category base in Settings>Permalinks to "general." All my categories are at mysite.com/general/... Now say I make a regular post and name it "General." Wordpress automatically assigns it the permalink "mysite.com/general". So, on my menus that list this post, this will be the link. However, when a user visits this link, Wordpress is set to recognize /general/ as the category base and it gives the user a 404 error. All subposts under "General" also have a permalink that begins with mysite.com/general/ and thus are seen as categories by apache mod_rewrite and become 404 as well.
Solution: users should not be able to have base pages whose names (and thus permalinks) are exact matches to the Settings>Permalinks>Category base value.
Change History (6)
comment:3 @solarissmoke — 4 years ago
- Keywords has-patch dev-feedback added; permalink 404 page name removed
comment:4 @johnbillion — 17 months ago
- Milestone Future Release deleted
- Resolution set to worksforme
- Status changed from new to closed