My web root is in /staging/ and I'm currently using this rewrite line:
location / {
# This is cool because no php is touched for static content
try_files $uri @rewrite;
}
location @rewrite {
# Some modules enforce no slash (/) at the end of the URL
# Else this rewrite block wouldn't be needed (GlobalRedirect)
rewrite ^/(.*)$ /index.php?q=$1;
}
However, there are some links that are using URIs with "/staging/" so it gets rewritten twice:
/staging/staging/somefile.png
Can you help me fix my rewrite line so all URIs with the string "/staging/" should not be repeated? Thanks in advance!
I was doing the rewrite in the wrong location! Placed the rewrite code in this section instead:
Any request to
/staging/file.jpg
is now rewritten as/file.jpg