所有...
我正在尝试在Nginx中做一些事情来重定向文件中的所有调用
/images/
成为:
/assets/images/
有人可以帮我制定重写规则吗?赋予301永久移动状态?
最佳答案
这是使用较新版本的Nginx的首选方法:
location ~ ^/images/(.*) {
return 301 /assets/images/$1;
}
有关更多信息,请参见https://www.nginx.com/blog/creating-nginx-rewrite-rules/。
关于redirect - nginx重写文件夹的重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18305189/