Finally I found the solution.
I think the problem was because I didn’t specify the rewrite rules for taxonomy archive page manually because I thought that I just want some simple url (default) so I didn’t have to add the rewrite rule at all.
So I tried the following code and add some flush rules hooked during activation of the theme:
add_rewrite_rule('tax-1/([^/]+)/\?posttype1=([0-9]+)?$', 'index.php?tax-1=$matches[1]&posttype1=$matches[2]', 'top');
The Monkeyman Rewrite Analyzer stating the following was also very helpful that I thought of that way:
This query variable is not public and will not be saved
It thus brought me to this link: How to properly rewrite url by custom var
Related Posts:
- Custom taxonomy terms as children of multiple custom post types
- Advanced search form with filters for custom taxonomies and custom fields
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- What should I use – Taxonomies, custom fields, Post Type?
- How to modify URL structures in custom post types and taxonomies or terms
- Creating Photo Gallery System with Custom Post Type
- Custom permalinks
- Permalink rewrite with custom post type and custom taxonomy
- Issues when rewrite rules collide?
- Custom Permalinks for Custom Post Types and Taxonomies
- WordPress returns 404 on custom rewrite rule conflict in parameters
- How to create download links based on Custom Fields with Rewrite API
- How to rewrite custom post type URL for multiple depths instead of one specific depth
- Custom post type category, taxonomy and URL rewrite problem
- Custom Taxonomy order by Custom Field
- Category base to url in custom post type/taxonomy
- Is there any performance consideration when using Custom Post Types?
- Custom post type / custom fields
- Is slug “type” reserved and can’t be used in taxonomy rewrite?
- Limit users by custom taxonomy and user roles
- Permalinks when filtering multiple custom post types by single taxonomy
- custom taxonomy archive by year
- Custom Posts Hierarchy? (State/City/Restaurant)
- need advice on how to do a lists using custom post types – taxonomy vs postmeta
- wp_query to find posts by year and month
- How can you handle rewrite rules for custom post types with option to filter on custom taxonomy terms?
- Conditional regex in add_rewrite_rule() for specific query filters & pagination
- How to Get Current Custom Post Type Selected Taxonomy Term (Not All Terms)
- Displaying a custom post types custom taxonomy value?
- Custom taxonomy in URL showing 404
- Custom Taxonomy URL are redirecting to page with the same name
- What template files do I need to customise custom-category-term-links rather than fall back on archive.php?
- search also in taxonomy, tags and custom fields
- Custom Post Types, URL rewrite on multiple CPTs
- Query & Order posts by custom fields
- How do I associate a custom post type with another through a taxonomy or storing an ID in a custom field?
- custom taxonamy and post type
- Taxonomy custom post type URL
- 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
- Show custom post type relationships by taxonomy
- How to rewrite url for any specific taxonomy?
- Custom post URL 404 error
- WP Rewrite Rule Issue while using Custom post type & taxonomy
- WordPress uses url different from defined in rewrite arg of custom post type
- Hierarchy and access control for Custom Post Types (CPT)
- Including taxonomy term before post type breaks top level pages
- Correct procedure for advanced permalinks
- CPT’s with landing page instead of archive – Url Rewrite?
- How to get list of taxonomy slugs ordered parents>childs?
- How to produce a sub-page-system in WordPress
- Custom taxonomy and post type with same slug
- Show fields based on taxonomy selection in editor
- Permalinks: custom structure for taxonomy – tags?
- WebP Fallback for Inline Background Image in Style Attribute
- Best way to specify “article type” in URL
- Creating custom post type with custom taxonomy and custom fields programatically
- I can’t access custom taxonomy page listing
- how to get this tax_query working?
- How to get_term_meta on single custom post?
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- Many to many to many custom post relationships
- Add term slug in URL of custom post type details page
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- How to fetch custom post types with its full data on wordpress?
- How to rewrite the post slug of a custom post type post
- Get custom term meta problem on single post type
- Modifying rewrite rules to use /category//
- Custom Post Type View Button in Admin Gives 400 Error
- Custom Post Type URL Rewrite’s
- Why does my URL keep returning 404 error code?
- Order custom posts by taxonomy, then by meta_key
- Writing a custom Glossary plugin
- ACF – Retrieve custom taxonomy from a relationship field
- Remove custom permalink base from CPT custom category and custom tags
- Display Posts that fit a certain criteria on Category pages
- How to handle this wordpress custom post type rewrite problem?
- How to search through all child taxonomies using WP_Query?
- Custom Post Taxonomy Template Not Loading Properly
- I want to create a metabox under custom taxonomy
- Problem with multi checkboxes value in metabox?
- Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post
- How to display only child category post in related posts in custom post type?
- Pretty Permalinks with CTP and Taxonomies / Hierarchical
- Customise Permalink Structure For Custom Post Types
- Query posts by multiple custom fields
- How to build overlapping custom post_type and taxonomy rewrites without conflicts?
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- WordPress is giving a warning but my code is working fine
- I have a custom taxonomy assigned to two post types. How do I create URLs for different term archives for each post type?
- Best way to use Category & Custom Fields?
- show custom taxonomies in hierarchy
- custom taxonomies are not showing up in get_taxonomies
- Parent cpt/child custom post type URL permalink relationship
- Storing/querying custom date data
- Order by custom field attribute
- Custom Post type as Taxonomy
- How to change custom post type slug without damage seo? [closed]
- Rewrite Rule for custom post type link with or without taxonomy terms
- I want to understand plugin implementation of custom posts / taxonomies / metaboxes