Apache Reference Manual (7)

Source: Internet
Author: User

<Location> directive
Syntax: <Location URL>... </Location>
Context: server config, virtual host
Status: core
Compatibility: Location is only available in Apache 1.1 and later.
The <Location> directive provides for access control by URL. it is similar to the <Directory> directive, and starts a subsection which is terminated with a </Location> directive. <Location> sections are processed in the order they appear in the configuration file, after the <Directory> sections and. htaccess files are read, and after the <Files> sections.
Note that URLs do not have to line up with the filesystem at all, it shocould be emphasized that <Location> operates completely outside the filesystem.
For all origin (non-proxy) requests, the URL to be matched is of the form/path/, and you shoshould not include any http: // servername prefix. for proxy requests, the URL to be matched is of the form scheme: // servername/path, and you must include the prefix.
The URL may use wildcards In a wild-card string ,'? 'Matches any single character, and '*' matches any sequences of characters.
Apache 1.2 and above: Extended regular expressions can also be used, with the addition of ~ Character. For example:
<Location ~ "/(Extra | special)/data">
Wocould match URLs that contained the substring "/extra/data" or "/special/data ". in Apache 1.3 and above, a new directive <LocationMatch> exists which behaves identical to the regex version of <Location>.
The Location functionality is especially useful when combined with the SetHandler directive. For example, to enable status requests, but allow them only from browsers at foo.com, you might use:
<Location/status>
SetHandler server-status
Order deny, allow
Deny from all

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.