IIS7.5 using Web. config to set pseudo-static methods

Source: Internet
Author: User

IIS 7 and IIS 7.5 and later versions estimate that the pseudo-static rules will be implemented using Web. config, so our previous pseudo-static files must be changed. Find a circle on the internet, have not found a more comprehensive web. config pseudo-static rules, so we are here to organize a copy for the first use of friends reference.

Implement a normal page, with a numeric parameter page and a pseudo-static with two parameter pages!

?
12345678910111213141516171819202122232425 <?xml version="1.0" encoding="UTF-8"?><configuration><system.webServer><rewrite><rules><rule name="Index" stopProcessing="true"><match url="^index.html" /><action type="Rewrite" url="index.php" /></rule> <rule name="Rule1" stopProcessing="true"><match url="^news_([0-9]+).html" /><action type="Rewrite" url="news.php?nid={R:1}" /></rule>  <rule name="Rule2" stopProcessing="true"><match url="news_list_([0-9]+)_([0-9]+).html" /><action type="Rewrite" url="news_list.php?nid={R:1}&page={R:2}" /></rule></rules></rewrite></system.webServer></configuration>

IIS 7.5 uses the Web. config to implement the 301 redirection method, the domain name without www is turned to the domain name with www!

?
123456789101112131415161718 <?xml version="1.0" encoding="UTF-8"?><configuration><system.webServer><rewrite><rules><rule name="Redirect" stopProcessing="true"><match url=".*" /><conditions><add input="{HTTP_HOST}" pattern="^chuangluo.com$" /></conditions><action type="Redirect" url="http://www.chuangluo.com/{R:0}" redirectType="Permanent" /></rule></rules></rewrite></system.webServer></configuration>

Since our website uses an escape character, you cannot directly copy the above code when you are actually using it. After copying and pasting into the editor such as Dreamweaver, use the Replace function to replace the double quotation marks with the double quotation marks in the English state, and then modify the contents of the rule label, then change to the URL of your own.

Note that the two parameters used in the previous Httpd.ini and. htaccess support URLs are & symbolic links, which are not supported in Web. config and need to be changed to & for normal use.

Original link: http://www.jb51.net/article/42901.htm

IIS7.5 using Web. config to set pseudo-static methods

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.