mod-rewrite Contexts of rewrite rules Rewrite rules in virtual host context


The virtual host context is a part of the static configuration file between <VirtualHost> and </VirtualHost> tags.

RewriteRule's in virtual host context match against the part of an url after the protocol, hostname and port, and before the query string.

When the following rule is used for the url, the regex in the first argument of RewriteRule is matched against /foo.


  RewriteEngine on
  RewriteRule ^/foo$ /bar [L]