Use the webpage program developed by asp.net and URLRewriter. dll for static.
A. Download urlrewriter.rar, decompress it, and put it in the/bin/directory.
B. Add urlrewriter.rar to the project reference.
C. Configure the IIS Site and point the extension html to the processing program aspnet_isapi.dll.
IIS Site-> properties-> Home Directory-> Configuration-> Add
The executable file is the same as the aspx file, which is c: \ windows \ microsoft.net \ framework \ v2.0.50727 \ aspnet_isapi.dll.
Do not check whether the file exists.
D. Add the configuration content in web. config, which is included in the compressed package.
Copy codeThe Code is as follows:
<ConfigSections>
<Section name = "RewriterConfig"
Type = "URLRewriter. Config. RewriterConfigSerializerSectionHandler, URLRewriter"/>
</ConfigSections>
<! -- Actual redirection -->
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor> ~ /(\ D * cmd.html </LookFor>
<SendTo> ~ /User/default. aspx? Link = $1 </SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<System. web>
<! --
You need to add html references to IIS and change them to aspx references.
-->
<HttpHandlers>
<Add verb = "*" path = "*. aspx"
Type = "URLRewriter. RewriterFactoryHandler, URLRewriter"/>
<Add verb = "*" path = "*. html"
Type = "URLRewriter. RewriterFactoryHandler, URLRewriter"/>
</HttpHandlers>
E. Enter [url] http: // localhost/1.html [/url] in the address bar to point to [url] http: // localhost/user/default. aspx? Link = 1 [/url]
Static configuration of 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.
This line is usually commented out and "#" is removed. If not, add the row.
B. Add the following code:
Copy codeThe Code is as follows:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/(%0-9%%%%%.html $/user. php? User = $1
</IfModule>
C. If the website is defined by a VM, add it to the VM configuration file. htccess. Otherwise
Unavailable.
D. Restart Apache and re-load 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]