Using Mod_rewrite With VirtualDocumentRoot

In our dev environment, we use VirtualDocumentRoot to avoid configuring new environments when we get a new developer. It’s awesome.

However, if you try to use mod_rewrite, you’ll find that your rewrite rules will prepend whatever you have defined as the document root in the config file. To get around this, you have to use the PT (passthrough) flag, which will solve the issue.

Example:

RewriteRule ^/photo/(.*) /open.php?id=$1 [L,NE,PT]

Found here, on an apache archive.