我的重写规则目前是:
rewrite ^/answer/1/(www\.)*(.)(.+)$ /answer/1/$2.html last;
所以请求如:
mydomain.co.uk/answer/1/aa
mydomain.co.uk/answer/1/www.aa
mydomain.co.uk/answer/1/www.aa/
mydomain.co.uk/answer/1/www.aa/something
mydomain.co.uk/answer/1/www.aa/something/even-deeper/and-so-on
提供文件:
mydomain.co.uk/answer/1/a.html
现在我想拆分响应,以便请求如下:
mydomain.co.uk/answer/1/aa
mydomain.co.uk/answer/1/www.aa
mydomain.co.uk/answer/1/www.aa/
将提供以前的文件:
mydomain.co.uk/answer/1/a.html
但是要求更进一步,例如:
mydomain.co.uk/answer/1/www.aa/something
mydomain.co.uk/answer/1/www.aa/something/even-deeper/and-so-on
将提供新文件:
mydomain.co.uk/answer/1/new.html
我应该如何更改上述正则表达式条件以适应要求?