Using the Web page program developed by ASP.net, use URLRewriter.dll to achieve static.
A. Download the Urlrewriter.rar and put it in the/bin/directory after decompression
B. Add Urlrewriter.rar to the project reference.
C. Configure the IIS site with the extension HTML pointing to the handler Aspnet_isapi.dll.
IIS site-> Properties-> home Directory-> configuration-> add
Executable files are the same as ASPX processing and are C:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll
Be careful not to choose to check whether the file exists.
D. Add the configuration content in the web.config, in the compressed package.
Copy Code code as follows:
<configSections>
<section name= "Rewriterconfig"
Type= "URLRewriter.Config.RewriterConfigSerializerSectionHandler, Urlrewriter"/>
</configSections>
<!--actual redirect-->
<RewriterConfig>
<Rules>
<RewriterRule>
<lookfor>~/(\d*) .html</lookfor>
<SendTo>~/user/default.aspx?link=$1</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<system.web>
<!--
You need to add an HTML reference to the IIS and change it to an ASPX reference
-->
<add verb= "*" Path= "*.aspx"
Type= "Urlrewriter.rewriterfactoryhandler, Urlrewriter"/>
<add verb= "*" Path= "*.html"
Type= "Urlrewriter.rewriterfactoryhandler, Urlrewriter"/>
E. Enter [Url]http://localhost/1.html[/url] in the address bar to point [Url]http://localhost/user/default.aspx?link=1[/url]
Static Apache WEB Server configuration based on Apache HTTP Server (conf/httpd.conf)
A. Find LoadModule rewrite_module in the httpd.conf file modules/mod_rewrite.so
Usually the line is commented and the "#" is removed. If not, increase the line.
B. Add code:
Copy Code code as follows:
<ifmodule mod_rewrite.c>
Rewriteengine on
Rewriterule ^/([0-9]+). html$/user.php?user=$1
</IfModule>
C. If a Web site is defined using a virtual host, be sure to add it to the virtual host configuration file. Htccess, or maybe
cannot be used.
D. Restart Apache and reload the configuration.
E. Enter [Url]http://localhost/1.html[/url] in the address bar and actually point to [Url]http://localhost/user.php?user=1[/url]