Carlo Carlo - 1 month ago 5
Apache Configuration Question

Wordpress hide category from url structure

I have url structure like this

http://www.domain.dom/blog/%category%/%postname%/


and in theme functions.php following rule

function wpa58471_category_base() {
// Remember to flush the rules once manually after you added this code!
add_rewrite_rule(
// The regex to match the incoming URL
'blog/([^/]+)/([^/]+)/([^/]+)(/[0-9]+)?/?$',
// The resulting internal URL
'index.php?category_name=$matches[1]/$matches[2]&name=$matches[3]&paged=$matches[4]',
// Add the rule to the top of the rewrite list
'top' );
}


Code found on this site

So now url in browser look's like this:
http://www.domain.dom/blog/cars/new-car-on-market/


Problem:

When users want to browse all posts in cars category the url is :

http://www.domain.dom/blog/category/cars/


I want to hide /category/ part. Is it possible ?

Thanks

Answer
Comments