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?
- Filtering categories in the permalink structure
- Multiple post categories – single permalink
- Display all posts from all categories with pagination
- Rewrite Rules for Multiple (more than 2) Taxonomies
- 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
- Categories’ hierarchy in URL
- Category and tag with same name
- Rewrite category slug
- Exclude subcategories from the url
- How to display only the parent category in the permalink
- Show posts of one category only with Custom Taxonomy on single.php
- Archive pagination causing 404 with permalinks structure
- Permalinks, Rewrites, Get Variables, Oh My!
- 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
- 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
- Pagination Not Working on Category.php page
- 3 Columns, 3 Categories, One Archive, and Pagination
- Broken category pagination
- ?cat=-1 Indexed Versions Of Homepage
- 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
- One Specific Category To Permalink
- Changed pagination URLS to use p= instead of paged=
- Can’t get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together
- Pagination is not working properly in Product Category/Tag pages
- Why category.php throw 404 in wordpress while calling paginate_links()?
- Paging not working in category.php
- How do I toggle pagination on/off in search results and category listings via a link?
- Enpoint Not Found in Rewrite Tag Permalink
- Multiple Loops on category.php with pagination on last loop
- Custom post and category template pagination problem
- Flat category URLs but retaining hierarchy?
- Custom category URL rewriting
- Pagination for ajax category filter
- Category template with pagination returns 404 on next pages
- How to display numbered pages in a category
- WordPress alphabetical A-Z custom post type post result display
- website with pretty permalinks except pagination
- How to show 1-5 of X Total Results
- Get wordpress installation folder
- How to link a PDF file to a category URL
- WordPress Rewrite rule is not working
- Pagination breaks on child-categories, works fine on parent-category
- Pagination for a category
- Conditional category query breaking?
- Category URL Management
- Category pagination not working
- How do I remove pagination from just some Categories?
- How to change an existing wordpress page rewrite rule?
- Using custom structure prefix showing 404 for sub-categories
- Add custom categories and subcategories and posts as custom pages
- pagination 404 error, same slug home and categories
- Pagination for custom categories template
- Unable to create pagination for Category.php
- Post url rewriting for posts with certain category
- “Next posts” of a category do not call category.php
- a way to support totally different url structure
- WordPress Category url redirects to subdomain
- How to add Pagination to foreach loop to page
- Hide category name using mod_rewrite
- WordPress pagination not working because of subcategory
- Paginations in Category Page Leads to Sample Pages
- Create monthly archive for parent category
- Transfering static site to wordpress and retaining category by month paginations
- Modify / Rewrite single template url structure
- Rewrite Rule & Regex – Extract ‘cat-name’ and ‘page-number’ from http://domain.com/custom-post-type/category/cat-name/page/page-number
- Paginating a list of all posts collected by category titles
- Paginate WordPress Category Pages
- Using pagination with multiple loops causes it to break
- Custom Taxonomy in Permalink from post type
- What approach should I take for this URL structure?
- Page permalink rewrite
- Why Pagination is not working on Category.php
- i want to add pagination list of categories
- Link to page in category
- Remove “?category=” in the URL wordpress ajax filter work for category
- Wrong rewrite rules