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并带上参数
.....
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并带上参数
相关文章推荐
- nginx代理指定目录
- 访问Nginx发生SSL connection error的一种情况
- Nginx+Naxsi部署专业级Web应用防火墙
- CentOS 6.2实战部署Nginx+MySQL+PHP
- nginx中http核心模块的配置指令2
- nginx中http核心模块的配置指令3
- nginx中http核心模块的配置指令4
- nginx中http的fastcgi模块的配置指令1
- Nginx 学习笔记(一)
- 网站502与504错误分析
- 艰难完成 nginx + puma 部署 rails 4的详细记录
- 把Lua编译进nginx步骤方法
- wordpress rewrite问题解决
- web 应用中常用的各种 cache详解
- Linux系统上配置Nginx+Ruby on Rails+MySQL超攻略
- window+nginx+php环境配置 附配置搭配说明
- 比较详细的Asp伪静态化方法及Asp静态化探讨
- ISAPI-REWRITE伪静态规则写法以及说明
- Apache rewrite重写规则的常见应用