我正在尝试重写我的/support
网址,因此我可以将“网页”作为附加的查询字符串抓取。
我现在遇到的问题是,我的assets
也包含在/support
子文件夹中,因此它们也会重新编写。
如何更改此选项以排除我的资产? (其中assets = / support / assets / styles,/ support / assets / scripts等...)
这是我当前的location
阻止
location /support/ {
index index.php;
rewrite ^/support/(.*) /support/index.php?_p=$1 last;
try_files $uri $uri/ /support/index.php?$args;
}
答案 0 :(得分:1)
在使用名为try_files
的{{1}}执行rewrite
之前,您可以使用location
检查资产。
例如:
location /support/ {
index index.php;
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/support/(.*) /support/index.php?_p=$1 last;
}
有关详情,请参阅this document。