Removing /category from WordPress URLs

February, 8 in Tip. Last modified: 2010-02-14.

WordPressAs you may noticed on this blog too, continues to show /category if you got rid of it from settings: this is caused by wp_list_categories(); and you can’t avoid this actually.

Elsewhere on my blog I use different functions, but I opt for that in the sidebar: I really hate this issue… luckily, there’s a quick solution.

Assuming you’re on – the most used way to get fancy s – with enabled, you can use to fix it.

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

This must be inserted before the WordPress’ standard rules: remember to replace the URL with your own domain. It’s case-insensitive and handles a redirection.

Short URL: http://wp.me/pKXtD-24 · Tags: , , , , , , , , ,

Share this post

delicious · Digg · Facebook Share · Google Buzz · Su.pr

closed

Syndicate Feed (941+)

Top