您的位置:首页 > 运维架构 > Nginx

nginx伪静态rewrite规则写法实例

2015-10-09 23:06 726 查看
在网站配置文件中www.huobo.cc.conf

.....

        server_name www.huobo.cc;

        index index.html index.htm index.php;

        root  /home/wwwroot/huobo;

......

在root 这行下面添加上 include huobo.cc.conf;

内容为:

location / {

            rewrite ^/[a-zA-Z]+/([0-9]+)/vod\-([0-9]+)-([0-9]+)\.html$ /video/index.php?$1-$2-$3.html last;

        }

这个规则是把http://www.huobo.cc/xiju/13239/vod-0-0.html重写到根目录下的/video文件夹中的index.php并带上参数
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息