我目前为用户提供了alex / available位置:
location ~* ^/alex/ {
rewrite ^/alex(/.*)$ $1 break;
我需要
- 添加新位置
/alexandru
;- 永久重定向从
醇>example.com/alex
到example.com/alex/
。
我使用location /alexandru
创建了新位置并且效果很好,但是当我尝试使用rewrite ^/alex(.*)/$ /$1 break;
进行永久重定向时,它失败了。
答案 0 :(得分:1)
快速而肮脏的解决方案:
location /alex {
rewrite ^/alex(.*) http://$server_name/url_to/alexandru$1 permanent;
}