Iis url rewriting (URL address ing)

Source: Internet
Author: User

for example, the address that can be submitted http://www.test.com/info_122.htm map to a real address http://www.test.com/info.asp? Id = 122 going up helps improve Google and other search engines.

Want IIS Supported URL Rewrite. You have to install one first. ISAPI

Click to download this file

Download and decompress the package to any folder. IIS Read permission, in IIS Right-click a site, properties, ISAPI Filter, add, the filter name must be Re , The executable file, Click Browse to find the directory you extracted Rewrite. dll Add.

Restart IIS to support URL rewriting rules.

You need to modifyHttpd. iniThis file

Rewriterule/info _ (\ D +) \. htm/INFO \. asp \? Id = $1 [N, I]

The submitted address can beHttp://www.test.com/info_122.htmMap to the real addressHttp://www.test.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 number. type is a data type)
Format: more_rj95.html

If the next page is displayed, the value is: more_2_95.html :
more_3_95.html , and so on.

however, You Need To httpd. INI Add the following Code :
rewriterule/more _ (\ D +) \. html/JSP/more \. JSP \? Page = $1 & type = $2 [N, I]

If your dynamicProgramIf multiple parameters need to be passed, multiple parameters will be added.(\ D +)As follows:

Rewriterule/more _ (\ D +) \. html/JSP/more \. jsp \? Page = $1 & type = $2 & type2 = $3 [N, I]

The page turning processing 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 Http://www.test.com/info.asp? Id = 50 # ABC Convert to static webpage
Because # ABC Is processed by the program Id = 50 After the static page is generated by this variable, the link in the page is made by the anchor. Therefore, the ing should be implemented.
Http://www.test.com/info.asp? Id = 50 # ABC Convert Http://www.test.com/info_50.htm#abc, The rewrite rules are as follows:
Rewriterule/info _ (\ D +) \. htm # (\ D +)/INFO \. asp \? Id = $1 #$2 [N, I]

 

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.