Website pseudo-static tutorial: using ISAPI_Rewrite or URLRewrite components

In SEO, static or pseudo-static website definitely has great benefits. Because search engines currently support parameters such as ?id= very well. However, in practice, we found that the URL form with parameters is still reflected in the indexing and indexing as less indexing .

If the original quality of your website page is 100% and the weight is very high, you should still pay attention to the static URL .

Because the current mainstream website server operating system is still in the windows2003 and windows2008 R2 versions. So in most cases, pseudo-static is for IIS6.0 version and IIS7.5 version.

Pseudo-static website in IIS6.0

In IIS6.0, the component to be used is called ISAPI_Rewrite , and we will provide the download address of this tool component at the end of the article.

After installing ISAPI_Rewrite, you need to open IIS6.0 first, and in the WEB service extension option, set " All Unknown ISAPI Extensions " to the allowed state.

Then right-click the website properties, in the ISAPI filter, add DLL, usually: C:\Program Files\Helicon\ISAPI_Rewrite3\ISAPI_Rewrite.dll

Write the name casually, such as ISAPI3

After adding, in the "ISAPI_Rewrite" option, click Edit, then write a rule, and then click Apply to save this pseudo-static rule. And execute the homepage of the website, then it will turn into a green arrow, as shown below.

You will find that the priority display is unknown, and this is ignored. As long as the pseudo-static rules of the website can be executed normally, it is successful.

Description and basic writing of ISAPI_Rewrite

ISAPI_Rewrite enforces pseudo-static rules by loading http.conf or http.ini.

The rules of ISAPI_Rewrite are generally:

RewriteRule ^index\.html$ index.asp [N,I]

RewriteRule ^list/list_(\d+).html$ /list.asp?id=$1 [N,I]

RewriteRule ^list/list_(\d+)_(.*).html$ /list.asp?id=$1&class=$2 [N,I]

Explanation: (\d+) corresponds to $1 , (\d+) is a regular expression that only matches numbers . (.*) corresponds to $2, which means to match any character including Chinese characters, English letters, etc.

RewriteRule ^list/list_(\d+)_(.*).html$ /list.asp?id=$1&class=$2 [N,I]

For example, the original URL of this piece is: list.asp?id= 5 &class= game

Then when the website is accessed using a static URL, list/ list_5_game.html will succeed .

Pseudo-static website in IIS7.5

First you have to install the URLRewrite component, there will be a download link at the end of the article.

After installation, click on the website in IIS, you will find a URL rewrite icon in IIS.

Other aspects are not used for any configuration. You can directly double-click this icon to write pseudo-static rules.

Description and basic writing of URLRewrite

URLRewrite只需要你安装URLRewrite组件后,点击IIS7.5中的网站,就可以找到“URL重写”选项。然后点击右侧的添加规则,添加一个空白规则。

URLRewrite的规则一般为:

模式里输入:

^list_(\d+)\.html$

重写URL里输入:

/list.asp?id={R:1}

其中,如上所述,(\d+)对应的是{R:1}的值。自己可以根据伪静态参数的复杂程度,自行添加{R:2}{R:3}这样的形式。如想让用户访问list_8_game.html 得到list.asp?id=8&class=game的数据,那么只需要设置为/list.asp?id={R:1}&class={R:2}即可。要注意对应顺序都是从左到右一一对应即可

最后,我们附上两个组件的下载地址:http://www.58day.com/bbs/v/28.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326045965&siteId=291194637