<Location> directive

Description: Applies the enclosed directives only to matching URL or virtual path
Syntax: <Location URL-path|URL> ... </Location>
Context: server config, virtual host

 

<Location> ... </Location> tag is used to group directives that will apply to specific URL or virtual path. <Location> sections operate completely outside the filesystem thus these directives should not be used to control access to filesystem locations since several different URLs may map to the same filesystem location.

The URL-path is a virtual path of the form /path/. No protocol, hostname, port, or query string may be included. URL-path may include wildcards ? and * or regular expression starting with the ~ character.

Example:

<Location /directory>

   # ... rules go here

</Location>


<Location />

   # ... more rules go here

</Location>

 

Don't forget to include RewriteEngine on directive in every <VirtualHost> tag or enclosed rules will not be applied.