0

I have several categories post:

General
News
Comedy
Competitions
Culture
Gaming
Food
etc

The posts url are in the following format:

www.mydomain.com/category-name/post-title

Example:

www.mydomain.com/food/how-to-make-paella
www.mydomain.com/gaming/game-of-theday

But I would like to hide from the URL the category name 'general' so for example.

instead of

www.mydomain.com/general/how-to-learn-spanish

have

www.mydomain.com/how-to-learn-spanish

I have tried some wiring a rewrite rule in the .htaccess but doesn't work.

Any idea how can I do it?

Thanks!

0

You can use post name in your permalinks setting. And for Category Base and Tag Base make it blank

Hope this will help

  • Hi @Aftab Alam I can do that but I want to show the category name in the URL except for only one category. Doing that all category names will not displayed in the URL. --Thanks – andresgl Sep 8 '16 at 14:09
0

Have you tried following Rewrite rule in your .htaccess ?

RewriteRule ^category/(.+)$ http://YOUR_SITE_NAME/$1 [R=301,L]
  • Hi @JItendra Rana yes, I have tried that one, but doesn't work :( --Thanks – andresgl Sep 8 '16 at 14:07
  • You could try out Yoast seo plugin. It has option to remove category from permalink. – JItendra Rana Sep 8 '16 at 20:14

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.