Reputation: 2688
I am attempting to rewrite my /support
url, so I can grab the "page" as an appended querystring.
The issue I am running into now, is my assets
are also contained in the /support
subfolder, so they too are getting re-written.
How can I change this to exclude my assets? (where assets = /support/assets/styles, /support/assets/scripts, etc...)
Here is my current location
block
location /support/ {
index index.php;
rewrite ^/support/(.*) /support/index.php?_p=$1 last;
try_files $uri $uri/ /support/index.php?$args;
}
Upvotes: 1
Views: 73
Reputation: 49692
You can check for the assets with try_files
before performing the rewrite
by using a named location
.
For example:
location /support/ {
index index.php;
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/support/(.*) /support/index.php?_p=$1 last;
}
See this document for more.
Upvotes: 1