I've written a set of REST APIs (Oracle ORDS) with the URL following format: https://servername:8443/ords/schema_alias/module_name/handler_name/p1/p2
The requirement from the client is that it be in the following format (will be used by an external tool): https://servername:8443/handler_name/p1/p2
We are using IIS and I tried to achieve this with URL Rewrite:
Pattern: ^handler_name/([_0-9-]+)/([0-9]+)
Action type: Rewrite
Rewrite URL: ords/schema_alias/module_name/handler_name/{R:1}/{R:2}
The Test Pattern option in URL Rewrite worked as expected.
However when I test the URL I get a page not found (404). I am able to verify the configuration in the C:\inetpub\wwwwroot\site_name\Web.config file.
Can anyone please shed some light as to why the web server does not recognise the URL?
EDIT: additional information after @Deepak-MSFT 's Answer
Below is my rule's configuration:

And the detailed error message:

I have added the folder, but that did not make a difference: C:\inetpub\wwwroot\b******MS

I have tested below URL Rewrite rule is rewriting the URL from
http://localhost:8443/handler_name/p1/p2tohttp://localhost:8443/ords/schema_alias/module_name/handler_name/p1/p2Test Result
If you still get the 404 error then make sure the path in the file system is correct and folder exists.
Further, you could share the screenshot of the detailed 404 error. It could show the module name that is having issue. It could help you narrow down the issue.