Asp url rewriting Technology (iis isapi)

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.