admin管理员组文章数量:1410737
I am trying to have a permalink strucutre as follows:
/category [List all the posts for the category]
/category/child-category [List all the posts for the child category]
/category/post-slug
My permalink settings is as follows:
/%category%/%postname%/
The category base is blank.
But if I navigate to /category/child-category from the URL bar, the link 404s. It only works when I navigate to /child-category without the parent category from the URL bar.
What would I need to do to have the permalink structure that I am trying to accomplish?
I am trying to have a permalink strucutre as follows:
/category [List all the posts for the category]
/category/child-category [List all the posts for the child category]
/category/post-slug
My permalink settings is as follows:
/%category%/%postname%/
The category base is blank.
But if I navigate to /category/child-category from the URL bar, the link 404s. It only works when I navigate to /child-category without the parent category from the URL bar.
What would I need to do to have the permalink structure that I am trying to accomplish?
Share Improve this question edited May 18, 2017 at 8:04 Niraj Pandey asked May 17, 2017 at 14:39 Niraj PandeyNiraj Pandey 1551 silver badge7 bronze badges 2 |1 Answer
Reset to default 1I figured out why this was not working. I had to set the category base to a dot(.) without any plugins but since I had 'Yoast SEO' Plugin instead, I had the not set the correct settings. To achieve the permalink structure I required:
Without Plugin:
- Go to Setting > Permalinks
- Select Custom Structure
- Add /%category%/%postname%/ after your domain
- Change Category Base to period/dot.
With Yoast SEO plugin:
- Go to Yoast SEO
- Select advanced
- Click on the tab permalinks at the top
- Check Strip the category base (usually /category/) from the category URL.
Here is where is got those steps from (and some other ways to remove category base)
本文标签: Custom Permalink with child categories creating 404
版权声明:本文标题:Custom Permalink with child categories creating 404 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744863027a2629181.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
/category/child-category/post-slug/
is how it should work with your permalink structure. – Max Yudin Commented May 17, 2017 at 16:32