To improve website access speed and search engine indexing, sometimes we need to convert dynamic aspx to static html. This conversion can be divided into two types: pseudo static and real static! These two methods have their own advantages and disadvantages. Let's skip this one today and explain how pseudo-static operations are completed.
First, we must haveMircosoft urlrewriter. dll will be downloaded from the Internet if it does not exist, and then they will be taken to the bin of the project.
Second, it is related to configuration in Web. config, which is also the most important
<? XMLVersion = "1.0"?>
<Configuration>
<Configsections>
<SectionName = "rewriterconfig"Type = "urlrewriter. config. rewriterconfigserializersectionhandler,Urlrewriter"/>
</Configsections>
<Rewriterconfig>
<Rules>
<Rewriterrule>
<Lookfor> ~ /Web/New/type/(. [0-9] *) \. html </lookfor>
<Sendto> ~ /Web/New. aspx? Id = $1 </sendto>
</Rewriterrule>
<Rewriterrule>
<Lookfor> ~ /Web/index.html </lookfor>
<Sendto> ~ /Web/index. aspx </sendto>
</Rewriterrule>
</Rules>
</Rewriterconfig>
<System. Web>
<Httphandlers>
<Add Verb = "*" Path = "*. aspx" Type = "urlrewriter. rewriterfactoryhandler, Urlrewriter" />
<Add Verb = "*" Path = "*. html" Type = "urlrewriter. rewriterfactoryhandler, Urlrewriter" />
</Httphandlers>
<Compilation DEBUG = "true"/> </system. Web>
</Configuration>
The blue Department is very important. You can add and modify it as needed;
Such as product_list.aspx? PID = 1 & page = 1
Configuration File: <lookfor> ~ /Product_list (\ D +) _ (\ D +) \. htm </lookfor>
<Sendto> ~ /Product_list.aspx? PID = $1 & amp; page = $2 </sendto>
& Amp: indicates the Connection Symbol when multiple parameters exist.
Set in the webpage: product_list + PID parameter + _ + Page parameter + ". htm"
When publishing to IIS, you must also handle the issue.
Right-click my computer> Manage> Expand services and applicationsProgram'--> Internet Information Service --> Find the shared directory --> right-click Properties --> click 'configuration' --> map to the following --> Find. aspx executable file path copy path --> Add --> paste path --> extension is ". html "--> then remove the check object check box. If the" OK "button becomes invalid, you can use the keyboard event to edit the path.