首页 ν 随手记 ν linux系统nginx环境下怎么配置301使其网址跳转网址 浏览量 收藏文章 海报

linux系统nginx环境下怎么配置301使其网址跳转网址

linux系统nginx环境下怎么配置301使其网址跳转网址。其实很简单哦!看下面:

要将这个页面

/about/show-1-1.html 做301跳转到 /about/topic-show-1-1.html

或者

/about/1.html 做301跳转到/about/

或者

/about/ 做301跳转到/about/1.html 

nginx的伪静态规则就这样写:

rewrite ^/about/show-([0-9]+)-1.html$ /about/topic-show-$1-1.html permanent;

rewrite ^/about/1.html$ /about/ permanent;

rewrite ^/about/$ /about/ permanent;

打赏 赞( )
微信
支付宝
微信二维码图片

微信扫描二维码打赏

支付宝二维码图片

支付宝扫描二维码打赏

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

技术栈-技术优质的资源信息

加入技术栈 联系我们