Note:Introduction to iis rewrite: A Powerful url Processing Engine with similar functions as mod_rewrite of apache. This is a list. asp tutorial for iis? The link id = 234 is mapped to list/234.html, which facilitates ranking in gg.
The biggest difference between full and lite is that each site can customize the url rewriting rule (rewrite rule), that is, as long as the httpd is written. you can use ini in the root directory of the site.
Installation instructions: After downloading, You can decompress isapi_rewrite.dll and httpd. ini files are placed under a folder, and then isapi_rewrite.dll can be loaded in the isapi of the iis Site attribute, httpd. ini is an example in the configuration file. If the load fails, set the isapi_rewrite.dll Security Attribute to complete.
2. In "iis manager", right-click the website and choose Properties.
3. Select "isapi" and click "add ".
4. Enter the Filter Name, for example, "rewrite ".
5. Click "Browse" at the bottom of the executable file, and select the location of the extracted rewrite component, rewrite. dll.
6. Confirm the selection and click "OK ".
7. Click "OK" to add the filter.
8. Restart iis.
9. After iis is restarted, right-click the site and choose properties. The Green Arrow shown below indicates that iis rewrite is successfully added and run.
Iis rewrite rule settings
In the decompressed iis rewrite component directory (such as c: rewrite), there is an httpd. ini file that writes the corresponding rules to this file.
1. Install the rewrite plug-in rewrite. dll
If your iis server has loaded rewrite. dll, you do not need to download it.
Rewrite. dll file: Baidu search keyword: rewrite. dll download
Load rewrite. dll
Add filter on iis isapi
Filter Name: re
Select rewrite. dll for the executable file!
2. Configure httpd. ini
Open your httpd. ini and find
[Isapi_rewrite]
#3600 = 1 hour
Cacheclockrate 3600
Repeatlimit 32
# Protect httpd. ini and httpd. parse. errors files
# From accessing through http
Rewriterule ^ (. *)/archiver/([a-z0-9-]+.html) $1/archiver/index. php tutorial? $2
Rewriterule ^ (. *)/forum-(%0-9%%*-(%0-9%%%%%%%.html $1/forumdisplay. php? Fid = $2 & page = $3
Rewriterule ^ (. *)/thread-(0-9000000000000-(0-9000000000000-(0-90000000000000000.html $1/viewthread. php? Tid = $2 & extra = page % 3d $4 & page = $3
Rewriterule ^ (. *)/profile-(username | uid)-(. + ?). Html $1/viewpro. php? $2 = $3
The above is discuz! The configuration code officially provided. Pay attention to the regular format.
3. Application
For example, read. php? Bl_id = 123 & bu_id = 456 pseudo-static/html/123/456 .html
You can write as follows:
Rewriterule ^ (. *)/html/([0-9] +)/(%0-9%%%%%%.html $1/read. php? Bl_id = $2 & bu_id = $3
To enable your iis server to support pseudo-static rewriting, follow these steps:
1. Install the rewrite plug-in rewrite. dll
If your iis server has loaded rewrite. dll, you do not need to download it.
Load rewrite. dll
Add filter on iis isapi
Filter Name: re
Select rewrite. dll for the executable file!
2. Configure httpd. ini
Open your httpd. ini and find
[Isapi_rewrite]
#3600 = 1 hour
Cacheclockrate 3600
Repeatlimit 32
# Protect httpd. ini and httpd. parse. errors files
# From accessing through http
Rewriterule ^ (. *)/archiver/([a-z0-9-]+.html) $1/archiver/index. php? $2
Rewriterule ^ (. *)/forum-(%0-9%%*-(%0-9%%%%%%%.html $1/forumdisplay. php? Fid = $2 & page = $3
Rewriterule ^ (. *)/thread-(0-9000000000000-(0-9000000000000-(0-90000000000000000.html $1/viewthread. php? Tid = $2 & extra = page % 3d $4 & page = $3
Rewriterule ^ (. *)/profile-(username | uid)-(. + ?). Html $1/viewpro. php? $2 = $3
The above is discuz! The configuration code officially provided. Pay attention to the regular format.
3. Application
For example, read. php? Bl_id = 123 & bu_id = 456 pseudo-static/html/123/456 .html
You can write as follows:
Rewriterule ^ (. *)/html/([0-9] +)/(%0-9%%%%%%.html $1/read. php? Bl_id = $2 & bu_id = $3
Another example:
123. php? Id = 123
123, id, 123
Rewriterule ^ 123/id/([0-9] [0-9] [0-9])/$/123.php? Id = $1
Or
Rewriterule ^ 123/id/([0-9] +) $/123.php? Id = $1
Pw rules: [isapi_rewrite]
Rewriterule ^ (. *)-htm-(. *) $ 1.php? $2
Rewriterule ^ (. *)/simple/([a-z0-9_]+.html) $1/simple/index. php? $2
Note: For example, the pseudo-static settings in interactive encyclopedia are similar to those in the setting method. The pseudo-static settings in other systems are similar, the possible difference is that the pseudo-static rule settings are different.
Personal remarks:
$1, $2, and $3 are the matching values of the previous expression.
For example:
^ (. *)/Simple/([a-z0-9_]+.html) $1/simple/index. php? $2