I’ve tested your first attempt with using a rewrite rule it works
add_action('init', 'add_html_ext_to_custom_post_type_taxonomies');
function add_html_ext_to_custom_post_type_taxonomies() {
add_rewrite_rule('^product_cat/(.+)\.html', 'index.php?product_cat=$matches[1]', 'top');
}
but you have _ not – had you noticed this as you give your example as www.mydomain.com/product-category/product-category-name.html
If its not a mistake it might be you have another rule conflicting with it? and also have you flushed the rules? You could check using the Rewrite Rules Inspector plugin and also you can use it to flush the rules if you haven’t already done so.
Related Posts:
- custom taxonomy and custom post type url conflict
- Edit Permalink Structure For Custom Post Type or Modify .htaccess?
- How to share category taxonomy with custom post type (The Event Calendar plugin)
- How to make a list of companies’ information and display them to user, using custom post types and a custom taxonomy?
- remove custom taxonomy metabox form custom post type
- How to Build a Movie Library in WordPress 3.x
- Custom Post Type causes Page Not Found
- Plugin allowing for artists, events and venues
- How does WP handle multiple matching rewrite rules?
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- List taxonomy terms for post as checkboxes
- ‘No Results Found’ on single post for custom post type
- auto populate list of questions if user select a category xyz
- “Custom Post Type Permalinks” plugin URL strcuture
- Plugin generated taxonomies’ permalinks with custom placeholders
- Redirect to another page using contact form 7? [closed]
- WordPress custom taxonomy not showing
- Custom url rewriting
- WordPress rewrite rules not working
- Do rewrites added with add_rewrite_rule() persist after plugin deletion?
- Rename existing cpt and taxonomy with new textdomain
- how to create hierachial taxonomy and manage under single post type?
- Need to edit author permissions | custom taxonomy
- Adding category base to url in custom post giving 404?
- Hidden permalink different from displayed permalink
- Cannot view Custom Post Type no matter what I try
- How To Use htaccess to Rewrite Link Structure for a Page that is Generated Programatcially
- URL Rewrite 404
- Get custom term link archive with prefix
- How To Rewrite WordPress Pages URL Only?
- CPT-onomies CPT_TAXONOMY->get_terms extremely slow with 6K posts
- Apache rewrite rules and wordpress problem
- How to list the categories by custom taxonomy created?
- Remove base from the custom post type URL [duplicate]
- Display Custom Post Type and Custom Taxonomy Data on Front End Using Only a Plugin
- Please Check this ‘.htaccess’ File
- How to rewrite URL using .htaccess in WordPress Plugin
- Failed to update a post when I add a taxonomy to it
- Is it possible to define a template for a custom post type within a plugin independent of the active theme?
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- Combining Multiple Taxonomies in one URL
- Permalink rewrite with custom post type and custom taxonomy
- Updating post meta for custom post types
- Template for custom post type shows all posts instead of just one
- Category base to url in custom post type/taxonomy
- How to install WordPress Multisite with different domains under the same subdirectory?
- 403 Forbidden – You don’t have permission to access /wp-admin/admin-ajax.php on this server
- How to delete terms on plugin deactivate?
- Best practice for adding posts in bulk
- Frontend editing, Frontend user dashboard
- Override plugin with functions.php
- 500 Internal Server Error when updating htaccess
- Rewrite url without flushing the database?
- how to add extra meta box or textarea into custom post types
- Should i delete the posts created by a plugin on uninstall?
- Is it possible to use WordPress as an online portfolio for text content? What kind of theme would I look for?
- How to make wp_enqueue_style and wp_enqueue_script work only on custom post type
- Custom taxonomy in URL showing 404
- Correct way to make meta box with more than one meta field secure
- I want to extend the current themes’ single.php to display the meta fields of my CPT
- more types plugin – display all post of post type on page
- How Can I Change the Custom Post Type Slug to the Taxonomy Slug in the URL?
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- admin-ajax.php warning max input vars exceeded on layered pop plugins [closed]
- Including taxonomy term before post type breaks top level pages
- Correct procedure for advanced permalinks
- How to get list of taxonomy slugs ordered parents>childs?
- Custom taxonomy and post type with same slug
- Custom Post Type Fields
- publish_post action doesn’t work
- Disable Individual Plugins (specifically in Custom Post Types) on a per-post basis?
- I can’t access custom taxonomy page listing
- How do we update a custom file upload field with the Advanced Custom Field plugin?
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- Username Variable in custom links?
- Custom Template for wordpress cpt plugin
- Custom Post Type URL Rewrite’s
- Get product categories and add them to a custom taxonomy
- add_rewrite_rule to load different page, without changing URL in browser
- Display posts by alphabetical order
- Can i stream data to a custom_post_type?
- Is there a hook similar to “save_post” which only fires AFTER the post is completely published?
- save_post hook partly firing in update post
- Page not found after creating the add new post slider using custom post type
- Get only selected custom taxonomy
- How to regenerate slugs for categories and tag converting non-Latin characters?
- Disable default posts (Posts,Pages,Comments and Media) in wp-admin
- Show similar category portfolio items?
- Parent cpt/child custom post type URL permalink relationship
- Custom Post Type Permalinks Problem
- Plugins for putting Custom Post Types into the Menu
- Insert data in custom table during new post creation
- Top Contributors Plugin with Custom Post Type
- featured image problem with custom post type
- Is an Office a custom post type [closed]
- My WP site and password was hacked, what to do? [closed]
- ACF Taxonomy Object term Null [closed]
- Snippet displaying LearnDash parent course title with lesson title [closed]
- Set the title of a custom post automatically by using info from custom fields?
- plugin translation *.mo file not getting loaded for custom post