我将服务器从Apache更改为Nghinx。一切都很好,除了旧的.htaccess不再起作用了。我想从这些表格中重定向链接
KeyError: 'booooot'
进入此
https://example.com/thelink.t123.html
https://example.com/thelink.t123
我以前使用的.htaccess代码在这里
https://example.com/NewFolder/thelink.123/
我试图将其转换为nginx代码
RedirectMatch 301 ^/.+\.t([0-9]+)(\.html)?$ https://example.com/NewFolder/$1
它将我的网站重定向到
location ~ ^/.+\.t([0-9]+)(\.html)?$ {
rewrite ^(.*)$ https://example.com/NewFolder/$1 redirect;
}
并给出此消息
https://example.com//NewFolder/NewFolder/NewFolder/NewFolder/thelink.123/