What you mention seems to be URL Rewriting which is at application level (not a specific even inside the application). Handling only one request in other way is not URL rewriting implementation.
You can
approach[
^] it either using:
-
ASP.NET Routing
Quote:
ASP.NET routing is used to dispatch a request to a handler based on the requested URL path. As opposed to URL rewriting, the routing module knows about the handlers and selects the handler that should generate a response for the requested URL. You can think of ASP.NET routing as an advanced handler-mapping mechanism.
-
IIS URL Rewriting
Quote:
URL rewriting is used to manipulate URL paths before the request is handled by the Web server. The URL rewriting module does not know which handler will eventually process the rewritten URL. In addition, the actual request handler might not know that the URL has been rewritten.
For more details, read here:
Using the URL Rewrite Module | Microsoft Learn[
^]
Quote:
The Microsoft URL Rewrite Module 2.0 for IIS 7 and above enables IIS administrators to create powerful customized rules to map request URLs to friendly URLs that are easier for users to remember and easier for search engines to find.
URL Rewriting Middleware in ASP.NET Core | Microsoft Learn[
^]
Quote:
URL rewriting is the act of modifying request URLs based on one or more predefined rules. URL rewriting creates an abstraction between resource locations and their addresses so that the locations and addresses aren't tightly linked.
A sample here:
An Example of URL Rewriting With ASP.Net[
^]