We want to set up domain.com so to route based on path, using wildcards like this:
for most cases, domain.com/* routes to one resource, keeping original domain BUT if URL is domain.com/blog/ , it redirects to blog.domain.com/ at another resource. Basically, we want to take whatever comes after /blog/ in the first URL and append it to blog.domain.com in the second URL.
Is there a way to reliably do that using routes and rule sets in Front Door?
I tried setting up 2 routes within an endpoint:
Seems like it works sometimes, but not always. domain.com/blog does not go to blog.domain.com. Some specific paths/pages on the blog redirect properly, but others do not.
I have tried with rule sets, but haven't been able to get it to take only part of the path (everything AFTER /blog/) instead of just all or nothing.
Is there a way to reliably do that using routes and rule sets in Front Door?
Yes , we can route the specific requests that match a routing rule. I have tried to replicate the same in local; here is the routing rule engine configuration for backend pool 1 and backend pool 2.
When incoming request comes as domain.com -> its turns to first route rule and load static web app If incoming request comes as domain.com/blog/ -> it turns to second route rule and load respective backend endpoint.
reference tutorial for more information
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.