0
我目前有各種重定向的URL網頁以下位置塊:NGINX:不贊成使用重定向的URL列表主頁
location ~ ^/events/?(.*)$ {
return 301 /;
}
location ~ ^/news/?(.*)$ {
return 301 /;
}
location ~ ^/about/?(.*)$ {
return 301 /;
}
...
從本質上講,所有/events, /events/, /news, /news/, /about, /about/
重定向到/
。
有沒有更乾淨的方式做到這一點,不是很溼?
美麗,非常感謝! – robinnnnn
這是一種樂趣,很高興我可以幫助:) –