我有這個配置
<VirtualHost *:443>
ServerName myserver.fr
SSLEngine on
ProxyRequests On
ProxyPreserveHost On
DocumentRoot /srv/apache2/htdocs/
Alias /subdomain/ /srv/apache2/htdocs/subdomain/
...
</VirtualHost>
當我請求時https://myserver.fr/子域名我收到 Apache 錯誤:
File does not exist: /srv/apache2/htdocs/app, referer:https://myserver.fr/subdomain
其中「app」是 /srv/apache2/htdocs/subdomain/ 的子資料夾
如果有用,這裡是 apachectl -S 的輸出:
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:443 is a NameVirtualHost
default server myserver.fr (/srv/apache2/conf/sites-enabled/default-ssl:2)
port 443 namevhost myserver.fr (/srv/apache2/conf/sites-enabled/default-ssl:2)
*:80 is a NameVirtualHost
default server myserver.fr (/srv/apache2/conf/sites-enabled/000-default:1)
port 80 namevhost myserver.fr (/srv/apache2/conf/sites-enabled/000-default:1)
Syntax OK