By Joan Piedra
Inspired by Category Base Removal Plugin
/%category%/%postname%
Add the following in your functions.php inside your current theme.
function kill_category_base ($string) { $string = str_replace('category/', '', $string); return $string; } add_filter('category_link', 'kill_category_base');
Change the following lines in your current .htaccess
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
For the following
# remove the category suffix - by Joan Piedra # http://joanpiedra.com/wordpress/remove-category-suffix-permalink RewriteRule ^(feed|comments)/(rss|feed)$ index.php/$1/$2 [L] # filter rss feeds RewriteRule ^([^/.]+)/(page/([0-9]+)|feed)$ index.php/category/$1/$2 [L] # redirect category pages and feeds # redirect everything else to wordpress RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php [L]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so.