Iis pseudo-static settings

Source: Internet
Author: User

1. Decompress the downloaded IIS Rewrite component and place it in an appropriate directory (such as C: Rewrite.

 

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:Http://blog.hxxsh.com/UploadFiles/2006-10/1013525016.rar 

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 click to add to favorites: "How to set pseudo-static html (URL Rewrite) under IIS"

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


PW rules: [ISAPI_Rewrite]
RewriteRule ^ (. *)-htm-(. *) $ 1.php? $2
RewriteRule ^ (. *)/simple/([a-z0-9_]+.html) $1/simple/index. php? $2

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.