문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top