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?
- How to make a page setting translatable in theme?
- Implementing a CrunchBase.com Clone using WordPress?
- Security and .htaccess
- WP_query parameters for date range
- What is the best way to output plugin result in certain url
- WordPress returns 404 on custom rewrite rule conflict in parameters
- flush_rewrite_rules not working on plugin deactivation, invalid URLs not showing 404
- Show Heirachy of categories in WP Download Monitor
- Best way to hook a custom url?
- Changed permalink structure. Need help with redirecting old posts
- Widget for adding HTML markup to a page
- Rewrite rule not matching
- URL rewrite of independent plugin?
- Custom permalink with child taxonomy terms
- WordPress add_rewrite_rules for custom URLs ending in .html
- ‘Organize Series Plugin’ as muti author feature
- Using ACF default value to autoincrement a number field
- Creating author Specific page URL
- How to Resize the Custom Post Images?
- posts from multiple post types in one slider
- URL rewrite with external JSON query
- Urls in Custom Post Type work for Terms but not for its Taxonomies
- Use jQuery Datepicker code from plugin
- Installed Forca Theme, wonder how I can alter Post editing screen
- How to force load a page in plugin?
- Posts 2 Posts: Display custom types connected to the same other custom type but with another connection
- custom post archive URL is wrong
- TranslatePress | secondary language category/sub-category not working correctly “`/%category%/%postname%/“`
- Import Recent Posts Only and Ignore old ones if exist
- WordPress REST API: Query media files attached to a custom post type
- How to get the custom field value using SQL query
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- How to display the category name in the tab and post inside the tab in WordPress?
- Want to build parent-child relationships between custom post types created with CPT UI
- Add an action based on custom post meta field
- Having a problem with rewrite_rules and rewrite_tags – url not rewriting properly and query var missing
- Ultimate Members Default Post Layout problem
- How to allow URL with filename & extension in wordpress?
- WP Migrate DB Pro plugin cannot transfer Media files to remote server
- Redirect Custom Post Type from Child Taxonomies
- Taxonomy question
- .htaccess file doesn’t work, with hundred tries
- Change default url to plugin custom post type
- redirect old post type url to new structure url
- Creating custom URL for async content
- Making a Custom Post Type Publish Loop
- Custom Post Type Base URL
- Plugin with custom domain
- WordPress User Frontend Editing Custom Fields
- WP Job Manger change jobs url (NOT slug)
- Make a magic tag work with Custom Post Types
- Set the title of a custom post automatically by using info from custom fields?
- public custom posts not showing in my wordpress plugin
- plugin translation *.mo file not getting loaded for custom post
- How to work with URLs where sometimes a post or a subcategory is in the same part of the URL structure
- Redirect OLD/Path to NEWURL/Path
- Create a custom taxonomy’s term form
- how to compare date meta value in jet smart filter Date query?
- Tickera missing attendees – No attendees found
- Load a custom post type template.html from a plugin