有这样形式的URLwww.example.com/abc/1.html
www.example.com/bdc/3.html
www.example.com/utf/2.html
若干个,希望重定向到对应的
test.example.com/abc/1.html
test.example.com/bdc/3.html
test.example.com/utf/2.html
abc,bdc,utf这样的目录是已知固定数量的那几个。
不用root 映射,直接用nginx的rewrite 应该如何写?
这个是我的写法:
location ^~/(abc|bdc|utf)/(*.html) {
rewrite ^~/*/(*.html) https://test.example.com/$! permanent;
}
不对呢~