all...
I am trying to do something in nginx to redirect all calls for files in
/images/
to become in:
/assets/images/
can someone help me with the rewrite rule? giving a 301 moved permanently status?
all...
I am trying to do something in nginx to redirect all calls for files in
/images/
to become in:
/assets/images/
can someone help me with the rewrite rule? giving a 301 moved permanently status?
Here's the preferred way to do this with newer versions of Nginx:
location ~ ^/images/(.*) {
return 301 /assets/images/$1;
}
See https://www.nginx.com/blog/creating-nginx-rewrite-rules/ for more info.
Add below configuration into your nginx.conf
rewrite ^/(images.*) /assets/$1 permanent;