网站改版,免不了做301重定向,thinkphp在nginx下的伪静态示例,以防备忘。
location / { if (!-e $request_filename){ rewrite ^(.*)$ /index.php?s=$1 last; break; } } rewrite ^/cn/([a-z0-9]+)-n([0-9]+)-1.html$ /$1/ permanent; rewrite ^/cn/([a-z0-9]+)-n([0-9]+).html$ /$1.html permanent; rewrite ^/cn/([a-z0-9]+)-a([0-9]+)-1.html$ /$1/ permanent; rewrite ^/cn/([a-z0-9]+)-a([0-9]+).html$ /about/$1.html permanent; rewrite ^/cn/([a-z0-9]+)-c([0-9]+).html$ /project/$1.html permanent; rewrite ^/cn/([a-z0-9]+)-c([0-9]+)-1.html$ /$1/ permanent; rewrite ^/cn/([a-z0-9]+)-c([0-9]+)-2.html$ /$1/2/ permanent; rewrite ^/([a-z]+)/$ https://$1.bmkj.net/ permanent; rewrite ^/tag/([a-z0-9]+)/$ /tags/$1/ permanent; rewrite ^/cn/tags.html$ /tags/keyword.html permanent; rewrite ^/cn/news-n-1.html$ /news/ permanent;
上一篇: 《建站管家》二次开发文档
下一篇: 宝塔面板操作日志提示未知错误: Traceback (most recent call last) 的解决方法