Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
From your setup, I see you have 2 requirements,
- "frontdoor-hostname/nonexistent/pagename.html" should go to "origin-hostname/uitemplates/default/pagename.html"
- "frontdoor-hostname/29399162-a18f-47d8-9f25-94b64d628fe6/pagename.html" should go to "origin-hostname/uitemplates/app1/24e9b7ae-8054-4f83-b548-3ecf45b9bfd5/pagename.html"
I did configure my Lab according to your set up and I was not able to override "Origin Path" by using Rule Sets.
You can consider not defining any Origin Path in the Request Routing Rules, at all.
Instead consider,
Route1
- Patterns to match : /*
- Origin path : <EMPTY>
- Rule set : ruleset1
Route2
- Patterns to match : /29399162-a18f-47d8-9f25-94b64d628fe6/*
- Origin path : /uitemplates/app1
Now, we define the default routing behavior in the ruleset1 applies to Route1,
- The URL Rewrite Rule should be something like the below,
- No If Condition, Only Then Action ----> i.e., all the requests to Route1 is Rewritten
- Source pattern : /
- Destination : /uitemplates/default/pagename.html
- This way, all the requests to Route1 are always overwritten to go to "origin-hostname/uitemplates/default/pagename.html"
- Further more, if you have a group of "guid"s, you can simply add them in patterns to match under Route2
I did a lab myself and I was able to get the below,
- As you can see, the default and non-existent GUIDs are going to the default path, "/uitemplates/default/pagename.html"
- And the valid GUID is going to the "/uitemplates/app1/pagename.html"
P.S :
- I understand that your scenario might be a bit more complex and you would like to have the "pagename.html" as dynamic (being index.html or pagename.css)
- In those cases, you may try to use the Regex as you have mentioned in your query.
I hope this adds more clarity.
Thanks,
Kapil
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.