Question

I am using dnsmasq and Apache 2.2.24,

so my http-vhosts.conf looks like this:

<VirtualHost *:80>
    VirtualDocumentRoot "/www/clients/%1"
    ServerAlias *.dev
    UseCanonicalName Off
</VirtualHost>

so that apache accesses myclient.dev like so: /www/clients/myclient/

This works as expected, but if I want to use it like so:

<VirtualHost *:80>
    VirtualDocumentRoot "/www/clients/%1/%1.src"
    ServerAlias *.dev
    UseCanonicalName Off
</VirtualHost>

so that apache accesses myclient.dev like so: /www/clients/myclient/myclient.src

The dot after the second %1 seems to cause a problem, so there is no server response at all.

I tried to escape the dot with \%1, but then Apache tries to access the directory like so:

/www/clients/myclient/myclient\\.src and cannot access the directory, obviously.

Any ideas on how to make that work?

Was it helpful?

Solution

The trick is to specify "%N.0." so the first dot is not misinterpreted.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top