How to remove the the word “category” from the URL

2019-09-05 15:37发布

问题:

I have a category by the name "mycategory". The URL of the category is currently - http://mixerp.org/blog/blog/category/mycategory/

but I need to change that URL to - http://mixerp.org/blog/blog/mycategory/

I tried playing around with the permalink settings but unfortunately I was unable to solve my problem. Currently, I have set the permalink settings to "Day and name". Can anyone kindly help me on this ?

回答1:

You should use a Custom Permalink if the other options aren't working. Make sure you delete the %category% part of the permalink, and this should solve your issue.



回答2:

you can do this by change in .htaccess file, First backup your .htaccess file. Then, open it and append the following line:

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

Once saved, your categories pages will be displayed like this:

http://mixerp.org/blog/blog/mycategory/

But i will prefer the answer given by Ronan Murphy, which is easy and safe



标签: wordpress