Less one slash URI Path

Source: Internet
Author: User
Tags iis

Today, Microsoft did not follow the standard of the practice toss a bit, write a blog to complain about.

Let's take a look at the standard definition (link) for the URI structure of the IETF (Internet Engineering Task Force):

Note that the path section (/over/there) above is a slash that contains the beginning.

Microsoft's eyes, however, are less the beginning of this slash---over/there.

When you use Microsoft's IIS Url Rewrite module to write a matching rule, you must exclude the beginning of this slash.

When you write routing rules using Routes.maproute in asp.net mvc, you must exclude the beginning of this slash.

When you face such a URI (http://www.cnblogs.com/), the matching rule is written as ^$.

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/net/

If you leave aside the standard, it is more reasonable to use intuition only, "/over/there" is better than "Over/there", because by the beginning of the "/" can intuitively know that starting from the root path, "Over/there" gives a person's intuition is a relative path.

If you're a programmer who uses Microsoft's platform for a long time, it may not be deep because of the habit, but if you're a programmer who has turned from a non-Microsoft platform, you're not used to it.

And I was tossing today not because from a non-Microsoft platform to Microsoft platform, but from Helicon Tech isapi_rewrite to Microsoft's IIS Url Rewrite module.

Today after migrating a site from IIS 7.5 (Windows Server 2008 R2) to IIS 8.0 (Windows Server 2012) (Incidentally, the IIS 8.0 is not compatible with the IIS 7.5 configuration file), it is found that Isapi_ Rewrite can cause IIS application pool crashes (503 errors) under some overriding rules and can only use IIS Url Rewrite module instead.

IIS URL Rewrite module supports importing URL rewrite rules from Isapi_rewrite httpd.ini configuration files, but because the URI path in Microsoft's eyes is unique, it has to modify each rule. Before, blog site was this problem toss, today again be toss, in the mind is very uncomfortable, so write blog chest!

As a programmer who has been using Microsoft platform for a long time, I am not accustomed to a slash in the URI path even if I do not encounter this URL rewrite problem!

Added

In Microsoft's URL Rewrite module's Help document URL Rewrite module Configuration reference, you can find the URI standard in Microsoft's mind:

For a HTTP URL in this form:http (s)://

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.