How to rewrite a Wordpress URL

I have a client that is using the wp-directory plugin and wants the URLS rewritten differently.

The plugin by default (if permalink is enabled) uses the following URL format:

 <<root domain>>/directory/wpdir-sub/cat-4/accountants/

My client wants the URL to display as follows:

 <<root domain>>/directory/accountants/

I have searched and searched and cannot figure out how to do this. I even looked at reworking the code, but the plugin needs the cat-4 parameter in order to know what to display.

Any assistance would be greatly appreciated!

I guess this wordpress redirection plugin will help you…
please visit :

http://wordpress.org/extend/plugins/redirection/

Bluebelt, thanks. I don’t want to redirect though, I need to rewrite. Appreciate your response though.

A little update. I did start looking at using the WP Rewrite functionality built into Wordpress to rewrite the URLs, but can’t get it to work. Here’s my code:

function wp_dir_rewrite($wp_rewrite) {
$dir_rules = array(
‘real-estate-directory/accountants?$’ => ‘wpdir-sub/cat-4/accountants’
);
$wp_rewrite->rules = $dir_rules + $wp_rewrite->rules;
}
add_filter(‘generate_rewrite_rules’, ‘wp_dir_rewrite’);

Seems like that should work, but it doesn’t. Any wp Rewrite gurus have any clue?

Have a look at the following link http://www.weddingwire.co.za/wedding-dresses/

I use a combination of pages and categories with the category base being set to ./ to achieve a result where I can have page content as well as display specific category posts on the same page.

The trick lies in that you dont have to have sitename.com/cat-name/post-name/, by using ./ as the category base it actually removes the /cat-name/

sitename.com/%cat-name%/%post-name%/