簡體   English   中英

AliasMatch捕獲的Apache重寫URL

[英]Apache rewrite URL to be caught by AliasMatch

我需要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>

這可能嗎? 我無法使它正常工作。

文檔中

如果希望將其他URL映射指令(例如Alias)應用於生成的URL路徑,請使用[PT]標志,如下所述。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM