Use the ASP. NET-developed Web program to achieve static using URLRewriter.dll.
A. Download Urlrewriter.rar, unzip and place in/bin/directory
B. Add Urlrewriter.rar to the project reference.
C. Configure the IIS site to point to the handler aspnet_isapi.dll with the extension HTML.
IIS site, Properties---Home directory, configuration--add
Executable file and ASPX processing are the same, both are C:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll
In particular, be sure not to check whether the file exists.
D. Add the configuration content in Web. config, which is in the compressed package.
<configSections>
<section name= "Rewriterconfig"
Type= "URLRewriter.Config.RewriterConfigSerializerSectionHandler, Urlrewriter"/>
</configSections>
<!--actual redirection--
<RewriterConfig>
<Rules>
<RewriterRule>
<lookfor>~/(\d*) .html</lookfor>
<SendTo>~/user/default.aspx?link=$1</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<system.web>
<!--
Need to add HTML references in IIS to the ASPX reference
-
<add verb= "*" Path= "*.aspx"
Type= "Urlrewriter.rewriterfactoryhandler, Urlrewriter"/>
<add verb= "*" Path= "*.html"
Type= "Urlrewriter.rewriterfactoryhandler, Urlrewriter"/>
E. In the Address bar enter [Url][/url] point to [Url][/url]
4. Configuration of a static Apache Web server based on Apache HTTP Server (conf/httpd.conf)
A. Find LoadModule rewrite_module modules/mod_rewrite.so in the httpd.conf file
Usually the line is commented out and the "#" is removed. If not, increase the line.
B. Add code:
<ifmodule mod_rewrite.c>
Rewriteengine on
Rewriterule ^/([0-9]+). html$/user.php?user=$1
</IfModule>
C. If the Web site is defined by using a virtual host, be sure to add it to the virtual host profile. Htccess, or maybe
cannot be used.
D. Restart Apache and reload the configuration.
E. Enter [Url][/url] in the address bar, and actually point to [Url][/url]
How do you make a dynamic page static by using an ASP Web-developed website?