Rewriting Asp.net URLs

I would like to use the ASP.Net URL to achieve the following:

My application is physically hosted in IIS at the following endpoint: http://www.example.com/someIISApplication/Default.aspx

I want the user to make a request with the following URL and click on the above endpoint with the querystring parameter as follows:

Requested from browser: http://www.example.com/ABC/someIISApplication/Default.aspx

Here's how it actually gets into ASP.Net after processing the route: http://www.example.com/someIISApplication/Default.aspx?MyParam=ABC

+5
source share
1 answer

You can use the URL Rewrite Module for IIS .

Create a redirect rule at the site level (www.example.com)

Output: ^ ([_ 0-9a-z -] +) / someIISApplication / Default.aspx

Redirect URL: someIISApplication / Default.aspx? MyParam = {R: 1}

For more information, see Creating rewriting rules for a reunion module.

+5
source

Source: https://habr.com/ru/post/1236344/


All Articles