TransWikia.com

Remove/hide a specify category-name from the url

WordPress Development Asked by andresgl on January 4, 2022

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!

2 Answers

Have you tried following Rewrite rule in your .htaccess ?

RewriteRule ^category/(.+)$ http://YOUR_SITE_NAME/$1 [R=301,L]

Answered by JItendra Rana on January 4, 2022

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

Hope this will help

Answered by Aftab on January 4, 2022

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP