Rewriterule with docroot on Redirect
Summary
If used /dev as an redirect target on websites, subdomains, aliasdomain, etc., it produces an error 403, caused by using a directoryname existing in /. The docroot is not used first.
Steps to reproduce
- Add /dev on redirect with no_flag
- Call the site
Correct behaviour
Get the contents of docroot/dev upon calling the site.
Proposed fix
Changing the RewriteRule in vhost.conf.master from:
RewriteRule ^/(.*)$ <tmpl_var name='rewrite_target'><tmpl_if name="rewrite_add_path" op="==" value="y">$1</tmpl_if> <tmpl_var name='rewrite_type'>
to:
RewriteRule ^/(.*)$ %{DOCUMENT_ROOT}<tmpl_var name='rewrite_target'><tmpl_if name="rewrite_add_path" op="==" value="y">$1</tmpl_if> <tmpl_var name='rewrite_type'>