What is the use of UrlRewrite?

Source: Internet
Author: User
Tags metabase

 

1. Meet Search Engine Requirements
Some search engines cannot capture dynamic pages, and a large amount of information cannot be searched by potential users. With UrlRewrite technology, you can set http: // server/news. asp? Id = 111 is changed to http: // server/news/111.htm so that they will be indexed by the search engine. Although google can capture dynamic pages, google generally scores dynamic pages less than static pages. Therefore, it is absolutely worthwhile to change the website address to static for a website with a large amount of information published.

2. Hiding Technology to Improve website portability
Every page is marked with a clear. asp/. jsp development language. You can see at a glance what language your website uses. When changing the website language, you need to change a lot of links. In addition, if a page has modified its extension, its pagerank will also disappear from the beginning. We can use the UrlRewrite technology to hide our implementation details. This makes it easy to modify and port data without losing pagerank.

3. satisfying aesthetic requirements
For website designers who are pursuing perfection, even the addresses of webpages must look concise and clear. Such as http: // server/news. asp? The webpage address of channel = 3 & id = 111 is definitely not perfect for the perfectionist. With UrlRewrite technology, you can change it to http: // server/news/3/111.htm.

Does IIS 5.0 support UrlRewrite?

The answer is simple, not supported. However, we can enable IIS support by installing server extensions.

Currently, two products support IIS 5.0 UrlRewrite, isapi_rewrite, and IIS Rewrite.

Isapi_rewrite: http://www.helicontech.com/download/#isapi_rewrite
IIS Rewrite: http://www.qwerksoft.com/products/iisrewrite/download.asp

Here, only one LITE version of ISAPI Rewrite is free, and others are trial versions. ISAPI Rewrite Lite version.

We use isapi_rewrite Lite Version (free Version ).

Reference:
This is simplified edition of ISAPI_Rewrite. It does not support per-virtual-site deployments, proxiing, metabase monitoring and automatic IC cache cleanup but all other features are supported.

Therefore, lite version does not support virtual site configuration, metadata monitoring, and automatic cache cleaning.

Metabase metadata: metabase refers to a data storage area in the memory where the configuration value of IIS is stored. /Metabase is stored as System32 \ Inetsrv
Metabase. binfile in the folder

 

How do I set UrlRewrite?

Isapi_rewrite uses a regular expression to replace the expression of the rule.

Below is a simple example where I want our users to input http: // server/test-12314.html to actually access http: // server/test. asp? Id = 12314. Then our matching expression should be/test-([0-9] * ).html, the corresponding format expression should be/test. asp \? Id = $1.

When writing regular expressions, you can use the regular expression test tool provided by isapi_rewrite (provided by default) for debugging. For example:

After matching expressions and formatting expressions are completed, we can put them in httpd. ini in the installation directory according to the following format.

Format: RewriteRule matching expression format expression
Example: RewriteRule/test-([0-9] * example .html/test. asp \? Id = $1

After the file is saved, you do not need to restart iis to take effect.

References:

URL Design for Google (Search Engine Friendly)
Http://www.chedong.com/tech/google_url.html

Isapi rewrite documentation
Http://www.isapirewrite.com/docs/

Operation instance:

1. download the ISAPI_Rewrite.ISAPI_Rewrite Lite and Full versions. the lite version does not support rewriting of each virtual host site and can only be processed globally. however, for friends with servers, the lite version is enough. lite Version: http://www.helicontech.com/download/, lite Lite Version (free.

2. Install the. msi file, just like the general program, and install it in D: \ ISAPI_Rewrite.


3. the next step is important. Take a look. open Internet Information Service, right-click, web site properties, and the e-ISAPI Filter tab. add a filter, enter the name, specify ISAPI_Rewrite.dll in the path, and then confirm.

To test. Create a New 1ting. asp, which will be written in

 

CODE: [Copy to clipboard]
<% = Request. querystring ("inso") %>
 

,

The result is 1ting. asp? Inso = * Browser display *.

5. This step is very important. It is a headache to add rewrite rules. Regular Expressions. Fortunately, this example is relatively simple.
Find the ISAPI_Rewrite directory, remove the read-only attribute of httpd. ini, and open edit. We want to delete 1ting. asp? Inso=im286 is of the 1ting-im286.html type. You need to add the following line to httpd. ini:

 

CODE: [Copy to clipboard]
RewriteRule/1ting-([0-9, a-z] * ).html/1ting. asp \? Inso = $1
 

, Save.

Http://gumanren.woku.com/article/1469064.html

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.