These two days
Program , Want to make static page generated, so the Internet to find some information, found the URL rewrite technology, for example, can submit the address http://www.xxx.com/info_122.htm to the real address http://www.xxx.com/info.asp? Id = 122, which helps improve the indexing rate of Google and other search engines.
Now, let's get started. If you want IIS to support URL rewriting, You have to install an ISAPI and click to download this file.
After downloading, decompress the package to any folder and give IIS users the permission to read data. In IIS, right-click a site, set properties, ISAPI filter, and add the Filter Name To re, click the executable file and find the decompressed directory rewrite. add the DLL.
Restart IIS to support URL rewriting rules.
You need to modify the httpd. ini file in the decompressed directory.
Rewriterule/info _ (\ D +) \. htm/INFO \. asp \? Id = $1 [N, I]
This sentence can submit the address http://www.xxx.com/info_122.htm to the real address http://www.xxx.com/info.asp? Id = 122
If you are processing data paging, the statement is as follows:
More _ <% = Page % >_< % = type %>. html (Note: page is the page turning page and type is the data type)
Format: more_000095.html
If the next page is turned over, it is: more_2_95.html. To continue the next page loop, it is:
More_3_95.html, and so on.
However, you need to add the following to the httpd. ini file:Code:
Rewriterule/more _ (\ D +) \. html/JSP/more \. jsp \? Page = $1 & type = $2 [N, I]
If your dynamic program has multiple parameters to be passed, add multiple parameters (\ D +) as follows:
Rewriterule/more _ (\ D +) \. html/JSP/more \. jsp \? Page = $1 & type = $2 & type2 = $3 [N, I]
The page turning format is: more_rj95.html
This blog is where I just installed the URL rewriting filter and modified some original code to make it semi-static. It is actually dynamic.
If you want to put the http://www.xxx.com/info.asp? Id = 50 # convert ABC to a static webpage
Because # ABC is a program that processes the variable id = 50 to generate a static page, and then links the page by the anchor.
Http://www.xxx.com/info.asp? Id = 50 # convert ABC to http://www.xxx.com/info_50.htm?abc, and rewrite the rule as follows:
Rewriterule/info _ (\ D +) \. htm # (\ D +)/INFO \. asp \? Id = $1 #$2 [N, I]
Download ISAPI