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
- How do I know if an archive correspond to a custom post type taxonomy?
- How to Display News in a Timeline with Headline, Category, and Time?
- Query Custom Post Types on Available Dates
- Adding CSS to custom post type admin page causes error
- ACF: post query, hide duplicate values [closed]
- How to rename custom taxonomy URL with extra words
- Custom Post Archive is not working
- Template filter for custom taxonomy terms
- Remove .htaccess portion upon plugin deactivation?
- WordPress add_rewrite_rules for custom URLs ending in .html
- Show all tags on custom post type
- What is the best way for showing a grid of customer logos?
- Custom Post Type Fields
- How to delete all trashed item in one-go
- Best way to specify “article type” in URL
- How can I use a file in my plugin as a replacement for single.php on custom-post-type query?
- Custom setup of wordpress comments that are displayed
- publish_post action doesn’t work
- Disable Individual Plugins (specifically in Custom Post Types) on a per-post basis?
- ‘Organize Series Plugin’ as muti author feature
- Using ACF default value to autoincrement a number field
- custom post type don’t appear in the home page
- Custom URLs in post types make it impossible to view archive
- Locked out of admin panel after installing HC Custom WP-Admin URL [closed]
- I can’t access custom taxonomy page listing
- Getting taxonomy images to display on single-post with their terms
- Where to populate custom terms in custom taxonomy in plugin?
- How to customize a title by passing query string?
- WordPress plugin url for form submit
- Default taxonomy template in plugin, override in theme
- Creating author Specific page URL
- How to Resize the Custom Post Images?
- Amazon.com intergration with WordPress?
- How to set category correctly for a custom post created by a remote API call?
- Sticky option for custom post types without using custom fields or plugins
- post_type_link Filter – Too Few Arguments
- How to use template_include hook with form submission?
- Trying to add a page template for my custom post type from a plugin, but it will not display in the template dropdown unless file is in theme
- Adding custom meta boxes to specified custom post type
- How do I make reusable content blocks for header and footer when using WordPress headless with another front-end?
- posts from multiple post types in one slider
- How do we update a custom file upload field with the Advanced Custom Field plugin?
- Custom Post Type – custom form in dashboard
- Add term slug in URL of custom post type details page
- Custom Post Type Advanced Slug
- $pages = get_pages(‘child_of=’.$post->ID); Why arguments are concatenated?
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- URL rewrite with external JSON query
- Getting only one post per category
- wp_insert_term() doesnt insert a term
- WordPress custom permalink and archive link for custom post type
- How to rewrite the post slug of a custom post type post
- Username Variable in custom links?
- How to get CPT category checkbox list and show post of selected(multiply) checkboxes via ajax?
- Urls in Custom Post Type work for Terms but not for its Taxonomies
- How to rewrite URL and get the values?
- Renaming Custom Taxonomy Values
- Multiple archives to display parent and subcategories content
- Modifying rewrite rules to use /category//
- WP-API Custom Post Type json_no_route
- Price comparison table based on Custom Post Type?
- How can I list custom post type categories of portfolio