Windows Server 2008R2 system IIS7.5 configuration pseudo static method (Urlrewrite) _win server

Source: Internet
Author: User
Tags microsoft iis

Looked up from the Internet, the original Microsoft IIS official website to IIS7 and in the subsequent version of the URL rewrite components provided.

Download Address: Http://www.iis.net/download/URLRewrite or http://www.jb51.net/softs/479310.html

First, open the above Web site to the IIS official website to download the module.

As needed, click on the download link on the right (the operating system is 64-bit, download the x64 version, 32-bit system, download the x86 version)

IIS version: IIS 7.5

URL Rewrite component: IIS URL Rewrite module (http://www.iis.net/downloads/microsoft/url-rewrite)

As needed, click on the download link on the right (the operating system is 64-bit, download the x64 version, 32-bit system, download the x86 version)

Note that the currently installed version is in English.

After the download is complete, install the rewrite module.
Download the local MSI package (Rewrite_amd64.msi or Rewrite_x86.msi), double-click the installation (you should stop the IIS service before you install it, and if the IIS service does not stop, you will need to reboot the system after the installation is complete.) )

When the installation is complete, open Internet Information Services (IIS) Manager, and you will see a more than one URL Rewrite module in the module.

Enter the site you want to set up, double-click the Url Rewrite icon to enter the settings interface.

Click Add rule (s) to enter rewrite rewrite rules.

After confirmation, click the "Apply" button on the right column, and you are done

Of course, you can also import from a previously configured pseudo static file: Httpd.ini or. htaccess that support ISAPI

Case:

Very friendly URL address that makes it easy for people to remember. It's not wonderful to ask your users to remember URLs like "Http://www.jb51.net/article.aspx?id=342&;title=URL-Rewrite-Walkthrough". If you provide users with the following URL address: Http://www.pipima.com/article/342/URL-Rewrite-Walkthrough, it will be better to resonate and more easily remembered.
Through the IIS URL Rewrite module (URL Rewrite module) you can easily establish this logic without having to modify the Rewrite maps code you are using. I will tell you to implement it from IIS Manager. Open IIS Manager, select Default Web Site, click URL Rewrite in the function view, and then in the Action Bar, click Add Rules ... to select Blank in the Select a Rule Templates dialog box Rule, you will open the Edit Rules property page and define the actual overrides (rewrite) by following these steps:
1, the rule name.
2, the pattern used to match the URL string.
3, set the condition option.
4, pattern matching and all conditions check after the success of the operation.
To implement the following example, the Edit Rule property page is shown in the following illustration:

The name of the rule should be unique (not repeated), and the matching string "^article/([0-9]+)/([_0-9a-z-]+)" is a regular expression that matches any URL string that satisfies the criteria:
1, starting with the "article/" character sequence.
2, after "/" contains one or more numeric characters.
3, after the second "/" contains one or more letters or "_" or "-".
Because we create a rule that supports overriding URLs, the rule type is "Rewrite." The rewrite string (Rewrite UR) "Article.aspx?id={r:1}&title={r:2}" specifies a new value for entering the overridden URL. Parameters we use "{r:1}" and "{r:2}", they will return a set of references (reference) defined by rule matching. About return references (back reference) you can refer to: URL Rewrite Module Configuration reference, for more on creating rewrite rules see: Creating Rewrite Rules for the URL Rewrite Module
One important thing is that the URL rewrite module needs to be installed before it can work, and you can do the following two versions:
x86 version: http://www.iis.net/downloads/default.aspx?tabid=34&;g=6&i=1691
x64 version: http://www.iis.net/downloads/default.aspx?tabid=34&;g=6&i=1692
The module (currently) supports only IIS7.0 and you should run IIS7.0 to benefit from it. If your project is developed using visual Studio for WEB developers, the project should be configured to run under iis7.0 instead of other Web servers.
For a detailed description of the URL rewrite module, see: http://learn.iis.net/page.aspx/460/using-url-rewrite-module/

Attention:

The first approach is to encode in web.config
Web.config is located in the physical path of the Web site project, if you do not generate one on your own.


Set the rules on the uninstall here yo


..................


The URLs in match and action are regular expressions


The above is to fill in the Web_config content of the specification.

The second method
Viewing the functional modules of a Web site, you will find that there is a "url rewrite" in IIS

Now the English version of the, Microsoft may be the Chinese version, but many people are not very good. Individual also update isapi_rewrite also quite good use.

After clicking Enter, the rightmost column finds "import rules"
[Reprint]windows Server 2008r2 system IIS7.5 configuration pseudo static page
Access to the rules file can be introduced. Note, however, that the format of the rule file is. htaccess. The mapping rules are still written by themselves. The style is as follows:
Rewriteengine on
# URL Rules (#为注释符号哟)
Rewriterule ^index.html$ index.php [L]
Rewriterule ^product-cat-([0-9]+)-([0-9]+). html$ product.php?mod=list&cid=$1&page=$2 [L]
#意思是前面的html会映射到后面的文件中. Rewriterrule's two links (barely called links) are the regular expressions. If you do not know the regular expression, just look at it, hehe

After the import is successful, "apply" on the right above remember to click, so the code automatically claims to Web.config.

The final step, regardless of handwriting config or through htaccess, the site will be restarted. So I can do it.

Related Article

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.