Something similar to this in your functions.php or a plugin will do the trick:
function custom_rewrite( $wp_rewrite ) {
$feed_rules = array(
'([^/]+)/cases/([^/]+).html' => 'index.php?genre=". $wp_rewrite->preg_index(1) ."&case=". $wp_rewrite->preg_index(2)
);
$wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
}
// refresh/flush permalinks in the dashboard if this is changed in any way
add_filter( "generate_rewrite_rules', 'custom_rewrite' );
You will need to refresh/flush your permalinks (WP Dashboard > Settings > Permalinks > Save Changes) when you add/edit/remove that code. You may need to adjust it slightly if it doesn’t work as is, but it demonstrates the basic principle of how to do it.
Related Posts:
- Permalinks: custom post type -> custom taxonomy -> post
- Mixing custom post type and taxonomy rewrite structures?
- Rewriting a custom-post-type permalink with taxonomy term?
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- Remove slug in taxonomy url
- Taxonomy, Terms, and Template Files
- Permalink rewrite 404 conflict- WordPress Taxonomies/ CPT
- Is there a way to use regular categories with custom post types?
- Dynamic taxonomy in permalink made all other posts NOT FOUND?
- Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error
- Help with a TV series Rewrite structure
- Rewrite permalinks for custom posttype and custom taxonomy
- How to check if last uri segment is a custom post type or taxonomy term?
- Custom permalinks – post type – hierarchical taxonomy’s
- Custom taxonomy & post slug permalink
- Including two taxonomies in a permalink structure
- WP Rewrite Rules – Custom post type & taxonomy
- Remove base slug in CPT & CT, use CT in permalink
- Permalink Structure problem with cpt and custom taxonomy
- Custom Taxonomy List links being re-written
- Page to display an archive of taxonomies
- Custom Post Types, Custom Taxonomies and Permalinks ?
- How to create a permalink for custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- Custom post type permalinks giving 404s
- Custom Taxonomies: Multiple Hierarchical Permailnks For A Single Post + Prev/Next Links
- How to show custom taxonomy in the permalink?
- Add the .html extension to custom post types
- Date-based permalinks for Custom Post Type, and custom taxonomy permalinks
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- Custom Permalink Tag breaks Pagination
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- Custom Permalink for Taxonimie and Custom Post Type
- Custom Taxonomy breaking pages permalinks
- Permalinks for custom post-types within custom taxonomies not found
- removing custom tax & CPT slug, adding taxonomy term in front of custom type
- Custom post type and taxonomy permalinks – Structure
- Custom Post Type and Custom Taxonomy Permalinks
- Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure
- Custom post types and permalinks
- Permalink Structure CPT With Custom Taxonomy Fails
- Parent & Child Taxonomy slugs in custom post permalink
- Custom Post Types and independent Categories – complex Taxonomy
- Change Permalink Structure for Tag.php template
- Use different taxonomies in different custom post types’ permalinks?
- Custom template won’t load for a custom post type (custom permalinks used)
- How to hook custom taxonomies to custom post types and make the permalinks work?
- How to have the same url structure for both a CPT and a Taxonomy?
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- Can’t remove front from permalinks for custom taxonomy category page
- Removing custom post type slug from URL
- Customize Custom Post Type URL
- Permalinks /country/city/cpt/postname/
- Seamless permalinks between Custom Taxonomy and Custom Posts
- Custom post type and custom taxonomy with the same slug using the file page taxonomy only as directory
- Custom Permalinks with CPT and Hierarchical Taxonomies
- How to have this permalink structure: post_type/postname/custom_inner_page
- Custom Permalink Structure for Custom Post Type, Custom Taxonomy, Under a page
- Custom taxonomy returns 404
- How to change permalink to include custom post type
- Custom post type, permalinks, taxonomies and blog posts
- permalink /category/post-name with custom post type and taxonomy
- Best way to specify “article type” in URL
- Template files for Custom Post Type and Taxonomy
- Template for custom post type when taxonomy is in the URL
- How to filter a custom post type by custom taxonomy without 404
- Using page title as a link to term archive
- Is it possible to have hierarchical taxonomy and hierarchical custom post types in one permalink?
- Custom category URL not displaying posts
- Multiple permalinks for a single post with multiple taxonomies
- Duplicate slug/permalink issue while adding same post name
- Error 404 change permalink term custom term taxonomy
- How do you create pillar content pages?
- Custom post type single page returning 404 error when sharing archive url with custom taxonomy
- Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post
- Pretty Permalinks with CTP and Taxonomies / Hierarchical
- Customise Permalink Structure For Custom Post Types
- % encoded URL giving 404 error in WordPress
- Issue with Custom Post Types and Permalinks
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Custom permalink with custom taxonomies for custom post type
- Pretty permalink structure with multiple (AND OR) taxonomies
- Change the url of a custom post type to include taxonomy
- How to have permalink structure based on taxonomy terms
- Multiple post types or single post type with category taxonomy?
- How can I add a “fake” parent into the permalink?
- Permalinks when using Custom Post Type with static page for archive
- How to change permalinks to taxonomy and post type’s posts
- Adding 2 CPT with multiple custom taxonomies to permalinks
- Parent cpt/child custom post type URL permalink relationship
- Custom Post Type Permalinks Problem
- Add taxonomy to custom post type archive
- Problem with Custom Post Types, Taxonomy, permalink, Archive
- Permalink for Custom Post Types
- Remove slug from Custom Category Permalink + dual-category permalinks
- Different CPT permalink base on taxonomy
- Hide custom post type slug url from search engine [closed]
- Is it possible for post and custom post type to share a category base slug?
- Modify permalink of CPT archive to support two taxonomies
- Permalinks for Custom Post Types and Taxonomies
- How to correctly edit permalink structures for both default and custom posts/taxonomies?