Let's say I have a post type "highschool" and I have a url structure for them like:
/highschool/hs1
/highschool/hs2
, etc.
I want to add some functionality like course booking but due to SEO/cache and other reason I don't what to use URL params like ?applyto=true but use URL structure like:
I'm sorry, but in support we don't have any special insight into custom rewrite rules.
We can point you towards where to add simple rewrite rules in the settings for the post type, or direct you towards WordPress documentation about implementing rewrites, but we can't come up with custom rewrite rules for you.
The question is not about rewrite rules in general - I find and use some references also.
The question is about how you process it in Toolset.
To be clear - if I will make this rules for the page, like
/pageforapplication/hs1/
/pageforapplication/hs2/
there hs1 and hs2 just a slug for Highschool custom posts
then they processed correctly with rewrite rule and I have no issues.
But if I want to add redirect rule as an extension after custom post like
/highschool/hs1/applyto
/highschool/hs2/applyto
then it just redirect me to the post itself to URLs:
/highschool/hs1/
/highschool/hs2/
Thats why I suppose this is not the problem of url rewrite, but the problem of how it combined with Toolset rewrites or rewriten URL processed within Toolset
Toolset do not offer such custom rewrite mechanism.
If you disable the Toolset and then try to register the post type using WordPress core function register_post_type() to create custom post type and then you add the rewrite code you shared you will have the same result. Its not on Toolset.
It will require custom code or you should be know how to deal with such custom rewrite rules. If you require custom programming for your project, please feel free to contact our certified partners:
- https://toolset.com/contractors/