I was able to solve it doing these rewrites in the following order.
So I specified 3 category url in the beginning
then 2 category url below that
and in the and
single category url
/combine/brand/category1/category2/page/1-9/
add_rewrite_rule(
'^combine/([^/]*)/([^/]*)/([^/]*)/page/([0-9]*)$/','index.php?category_name=$matches[1]+$matches[2]+$matches[3]&paged=$matches[4]', 'top'
);
/combine/brand/category1/page/1-9
add_rewrite_rule(
'^combine/([^/]*)/([^/]*)/page/([0-9]*)$','index.php?category_name=$matches[1]+$matches[2]&paged=$matches[3]', 'top'
);
/combine/brand/category1/
add_rewrite_rule(
'^combine/([^/]*)/?([^/]*)/([^/]*)/?','index.php?category_name=$matches[1]+$matches[2]+$matches[3]', 'top'
);
Related Posts:
- Preventing index.php?category_name=something from redirecting
- How to set up Author archives with sub category URL
- How to change category and year archive permalinks/rewrite rules?
- Rewrite with pagination /foo/page/2/ to posts of a given category, page 2
- Custom url structure – pages under a custom post type
- How to remove parent category from child category url using wordpress rewrite rule?
- Remove “category” from permalink with add_rewrite_rule
- Change the “page” slug in pagination
- Display posts from the same category using next/previous post link
- How can I create a category landing page followed by pages of posts?
- Posts URL structure like site.com/category/the-post-title
- Problem with add_rewrite_rule and pagination (paged and page query_vars)
- Filtering categories in the permalink structure
- Rewrite rule page url with category
- Multiple post categories – single permalink
- Display all posts from all categories with pagination
- Rewrite Rules for Multiple (more than 2) Taxonomies
- Add forward slash on categories url (serve one version of a url)
- how to use a different domain/subdomain for authors/catagories on single site?
- Disable wordpress pagination URL rewrite for specific page
- Custom post types with their own permalink structure
- Show Previous/Next Posts navigation only inside the same category
- Rewrite category wordpress
- Categories’ hierarchy in URL
- Category and tag with same name
- Rewrite category slug
- Changing the category permalink structure
- How to? Redirect /category/sci-fi/ to /category/scifi/?
- Exclude subcategories from the url
- How to display only the parent category in the permalink
- Page navigation within a category
- Show posts of one category only with Custom Taxonomy on single.php
- Pagination on child category returns 404
- Disable pagination only for specific category
- Archive pagination causing 404 with permalinks structure
- Custom category template pagination problem
- How can i call an article from each category and still paginate properly?
- Plural Category Base Slug On Category Archive Page
- Show posts of category in a page
- Permalinks, Rewrites, Get Variables, Oh My!
- Add ‘articles’ prefix before blog posts url without affecting pagination
- Force category-slug.php to show page, even if it doesn’t exist
- custom permalink/shortlink with base62 encoded post ID
- Custom Category/Subcategory structure
- Remove “/page/1” from the URL
- One WP install, I need to map a custom domain name to each category
- Pagination problem
- How to show in search results posts with a particular tag in a particular category?
- Default category link for a custom category is a broken link
- Categories not working – 404 Not found error
- Custom query_vars and parse_request on wp-admin
- Viewing category pages without the word ‘category’ in URL
- What’s the Simplest Way to Override/Rewrite the %category% Permalink Structure Tag?
- How to add custom variable in url without redirect?
- Pagination Not Working on Category.php page
- 3 Columns, 3 Categories, One Archive, and Pagination
- Broken category pagination
- ?cat=-1 Indexed Versions Of Homepage
- Should the actual /category/ directory be 404? Is that normal WP behaviour
- force category base – archive pages work WITH & WITHOUT category base slug in url?
- Disable Pagination on Pages
- Add “page-a” slug to category link if user visit category link from “page-a”
- Pagination for category slug returns 404 when page >= 2
- Rewrite a category
- How do I get rid of “category” from my URL structure?
- One Specific Category To Permalink
- Changed pagination URLS to use p= instead of paged=
- Pagination not visible on woocommerce’s category page
- Can’t get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together
- Rewrite URLs – Custom Post Type – Post Slug, Taxonamy Slug
- Pagination is not working properly in Product Category/Tag pages
- Restoring default article pagination on archives – Removing custom limits
- Category archive rewrite rule to include category/subcategory?
- The default code for “posts_nav_link” on category.php isn’t working
- Read GET parameters in APACHE Mod Rewrite rules for WordPress categories in Posts
- Why category.php throw 404 in wordpress while calling paginate_links()?
- Taxonomy Pagination Rewrite
- Paging not working in category.php
- Custom permalink leads to index page
- Add /category/ to an author archive page
- How do I toggle pagination on/off in search results and category listings via a link?
- Permalinks: display just one kind of wp category in the posts url
- Multiple URL’s based on category for one post
- Help with rewrite rules for two post types
- Enpoint Not Found in Rewrite Tag Permalink
- Multiple Loops on category.php with pagination on last loop
- Remove subcategory and category with some rules from permalink
- WordPress URL Rewrite for dynamic and customized URL
- Custom post and category template pagination problem
- How to make the link to the category for a post go to corresponding page number in archive?
- Flat category URLs but retaining hierarchy?
- Custom category URL rewriting
- Category archives with monthly pagination
- category pagination got broken suddenly
- Pagination for ajax category filter
- Category template with pagination returns 404 on next pages
- Adding a rewrite rule to page that has no fixed variables and pagination
- How to display numbered pages in a category
- WordPress alphabetical A-Z custom post type post result display
- website with pretty permalinks except pagination