1

I'm trying to set up some permalinks for my site. Right now all the posts are under sitename.com/blog/, which is fine. But the category pages and tag pages show as 'sitename.com/blog/category/catname' and 'sitename.com/blog/tag/tagname'.

Is there a way to just skip the 'category' and 'tag' parts of the URL? As in: 'sitename.com/blog/catname' 'sitename.com/blog/tagname'

I tried leaving the optional settings (Settings --> Permalinks --> Optional) as blank for 'Category base' and 'Tag base', but they default to 'category' and 'tag', which brings me back to my previous problem.

I then tried putting 'blog' instead. It works for the categories and tags, but it then makes all the posts redirect to a 404 page. It's as if it searches for a category/tag with the name of [postname] and on failing to find one, 404s me.

Anyone having this trouble / found a workaround for this?

1

I was messing with my permalinks today for the same reason. And i ended up with a solution that worked great.

You have to change your custom permalink structure to:

/%category%/%postname%/

In the category base field just put a period mark:

.
and your permalinks will display in this form:

CATEGORY PAGE
mysite.com/blog/category-name/

POST PAGE
mysite.com/blog/category-name/post-name/

I don't think it works for tags pages though. I tried putting "." in the tag base field the permalink is correct like:

TAG PAGE
mysite.com/blog/tag-name/

but the page returns error 404. So i guess it doesn't see the page without the default "tag" tag base.

0

Advanced permalinks plugin might solve your issue


advanced permalinks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.