全球主机交流论坛

标题: 求住一个nginx跳转规则 [打印本页]

作者: 每次醒来    时间: 2013-4-6 15:07
标题: 求住一个nginx跳转规则
http://123.com/neirong/*.html      >跳转到 带www的http://www.123.com/neirong/*.html
http://123.com/neirong/*-*.html   >跳转到 带www的http://www.123.com/neirong/*-*.html  

* 代表变量

作者: aarwwefdds    时间: 2013-4-6 15:21
rewrite ^/neirong/(.*)-(.*).html http://www.123.com/neirong/$1-$2.html permanent;
rewrite ^/neirong/(.*).html http://www.123.com/neirong/$1.html  permanent;

自己测试。顺序不能倒,照理NginX是按照顺序解析的




欢迎光临 全球主机交流论坛 (https://sunk.eu.org/) Powered by Discuz! X3.4