In ASP. NET, the URL rewriting method is used to set the pseudo-static state (test successful)

Source: Internet
Author: User

This article comes from this path (http://www.w17x.com/AritcleDisplay.aspx? Id = 768) Personal archive only

There are many configuration methods on the Internet, but many of them are not set successfully. This is a success and you can use it directly.

The method is as follows:

<? XML version = "1.0"?>

<Configuration>
<Configsections>
<Section name = "rewriter"
Requirepermission = "false"
Type = "intelligencia. urlrewriter. configuration. rewriterconfigurationsectionhandler, intelligencia. urlrewriter"/>
</Configsections>

<Appsettings/>
<Connectionstrings/>

<System. Web>
<Httpmodules>
<Add name = "urlrewriter" type = "intelligencia. urlrewriter. rewriterhttpmodule, intelligencia. urlrewriter"/>
</Httpmodules>

</System. Web>
<System. webserver>

<Modules runallmanagedmodulesforallrequests = "true">
<Add name = "urlrewriter" type = "intelligencia. urlrewriter. rewriterhttpmodule"/>
</Modules>

<Validation validateintegratedmodeconfiguration = "false"/>

</System. webserver>
<Rewriter>
<Rewrite url = "pagename _ ([0-9] {1,}) \. aspx" to = "default. aspx? Id = $1 "/>
<Rewrite url = "pagename _ ([0-9] {1,}) _ ([0-9] {1 ,})\. aspx "to =" default. aspx? Id = $1 & amp; page = $2 "/>
</Rewriter>

</Configuration>

In addition, if you want to configure pseudo-static to a suffix such as HTML, you need to set IIS In addition to changing the aspx in the configuration rules to HTML.

IIS setting method:
Internet Information Service --> Find the directory you shared --> right-click Properties --> click 'configuration' -->
Ing the following --> Find the executable file path copy path of. aspx --> paste path --> the extension is ". html" --> and remove the check file

In this way, you can

Download the DLL file in BIN to the attachment.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.