Remove Category and or Tag from URL in Wordpress 3

After spending some time mucking about with Wordpress, I've finally been able to remove those troublesome /category/ and /tag/ folders from my urls.

To do so, first add the following to .htaccess file:

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

Make sure to put this before the www/no-www redirect section -- this is what tripped me up before.

Now, your urls will be of the type http://example.com/category1 instead of http://example.com/category/category1.

You may notice however, that the category links under the posts still show the /category/ tag. For this, we go to the permalinks section and change the permalink structure to

/%category%/%postname%/

AND

change the category base to

./

Save it like that and you should be in business -- the url links under posts will no longer have /category/ or /tag/ appended to them (for the purposes of removing /tag/, just follow the above instructions while making the substitution for /category/.