Unable to include "$1" in website redirect

When adding an entry in Server Configuration -> Website Redirects, type "Directory on this system", and "Include sub-paths in redirect" set to yes, Virtualmin correctly creates an "AliasMatch" directive.

To make proper use of that, I have to include the matched part of the URL expression in the directory path, in form of the text "$1". The help text für "Include sub-paths" correctly states so:

However, if Yes is chosen you can use the special code $1 in the destination URL. This will be replaced by the sub-path or filename that comes after the source URL path.

However, when I try to do that, I get:

Failed to save redirect : Missing or non-absolute destination directory

While this message is technically correct, since there is no (exemplary) path /home/domainname/public_html/joomla/$1 on my system, the message is still rather unfortunate in this situation. :-)

Status: 
Closed (fixed)

Comments

Thanks for pointing this out - the bug is that Virtualmin checks that the destination directory exists, even though the $1 gets substituted for something else, which makes the check invalid.

I will fix this in the 3.84 release. The work-around till then is to create the directory that ends with $1 , which will never be used but will satisfy the check.

Roger, and you're welcome!