我需要mod_rewrite来重新映射传入的URL,以便它被AliasMatch捕获。
RewriteCond %{REQUEST_URI} ^/app/(.*)$
RewriteRule ^/app/(.*) ^/dev-dave/app/$1
RewriteCond %{REQUEST_URI} ^/static/(.*)$
RewriteRule ^/static/(.*) ^/dev-dave/static/$1
AliasMatch ^/(.*)/static/(.*)$ /var/www/html/cosmos/$1/dist/static/$2
AliasMatch ^/(.*)/app/(.*)$ /var/www/html/cosmos/$1/dist/index.html
<Directory /var/www/html/cosmos>
AllowOverride None
Require all granted
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
</IfModule>
</Directory>
这可能吗?我无法让它发挥作用。