I have static front-page and separate page /news/
as the Posts page. I would like to have the single-post URLs like this:
www.example.com/news/categoryname/subcategory/postname/
and for the category archives:
www.example.com/news/categoryname/
What I've tried already:
If I add
news
as my category base and/news/%category%/%postname%/
as the custom permalink structure, I get the desired URLs but also 404 error for single posts (both withnews/
in URL and without it). All other pages (e.g. category archives, pages etc.) are accessible.If I leave category-base empty and permalinks as
/news/%category%/%postname%/
, there are no 404 errors, but category URLs additionally contain the defaultcategory
slug, like so:www.example.com/news/category/categoryname/
If I use plugins to remove the default category base or just set category base to
.
it's removed together with thenews
partIf I set permalinks as
/%category%/%postname%/
and add only the category basenews
, there are also no 404 errors, but links to posts don't start withnews
:www.example.com/categoryname/subcategory/postname/
There are some similar unanswered questions: Posts not showing with custom categorybase and subcategories and wordpress permalinks tweeks