location 将多级目录下的文件转成一个文件
/ck-135-201-7142.html 指向/ck/135/201/7142.html
[root@web01 www]# cat /app/server/nginx/conf/rewrite/default.conf
#rewrite ^/index\.html /index.php last;
#if (!-e $request_filename) rewrite ^/(.*)$ index.php last;
#if (!-e $request_filename) {rewrite ^/(.*)$ /index.php last;}
#if (!-e $request_filename) {return 404;}
#if ($http_user_agent ~ Firefox) {rewrite ^(.*)?$ /nginx-Firefox/$1 break;}
#if ($http_user_agent ~ MSIE) {rewrite ^(.*)$ /nginx-MSIE/$1 break;}
#rewrite ^/(\d+)/(.+)/ /$?id=$ last;
#location ~ ^/(cron|templates)/ {deny all;break;}
#location ~ ^/data {deny all;}
#location ^~ /html/m.js {access_log off;root /app/www;expires ;break;}
rewrite ^/ck-([-]+)-([-]+)-([-]+)\.html$ /ck/$/$/$.html last;
[root@web01 www]# tree default/ck/
default/ck/
└──
└──
└── .html directories, file
[root@web01 www]# cat default/ck///.html
bass clnking@.com
[root@web01 www]# curl http://192.168.1.24/ck-135-201-7142.html
bass clnking@.com
location 将多级目录下的文件转成一个文件的更多相关文章
- 位于/var/log目录下的20个Linux日志文件
位于/var/log目录下的20个Linux日志文件[译] from:http://buptguo.com/2014/01/16/linux-var-log-files/ 原文地址:20 Linux ...
- QT工程构建目录下,将生成的中间文件和可执行文件分离
在QT工程中,当我们选择了构建目录后,编译生成程序后,总会发现在debug目录下会有混淆着各类文件,如下图 很多时候,我们又仅仅只需要可执行文件或者自定义的动态链接库.如下图 当然,如果不觉得麻烦,有 ...
- copy指定目录下包括子目录中所有的文件
#include <windows.h> #include <iostream> #include <string> using namespace std; DW ...
- Java Web中提交表单之后跳转到WebContent目录下的子目录里的jsp文件
最近在做一个系统,需要完成登录动能进行跳转到另一个页面.在这个项目里面,我把 jsp,css,js文件都统一放在 WebContent 目录下的一个 WebPage 里面. 按照以前的习惯,写好了 s ...
- IO流-递归遍历目录下指定后缀名结尾的文件名称
/* *自定义遍历目录下指定后缀名结尾文件的名称的方法: * * param file:指定目录 name:指定后缀名 */ 1 public static void FileName(File fi ...
- Linux查找目录下的按时间过滤的文件
在维护项目中,有时会指定都一些条件进行过滤文件,并对该批文件进行操作:这时我们将使用shell命令进行操作:直接上代码 #!/bin/sh #BEGIN #`find ./ ! -name " ...
- 将二级目录下的文件合并成一个文件的Python小脚本
这个小程序的目的是将二级目录下的文件全部合并成一个文件(其实几级目录都可以,只要做少许改动) #coding:utf8 import sys, os def process(path): new_fi ...
- linux 批量替换文件内容及查找某目录下所有包含某字符串的文件
转载请注明来源:https://www.cnblogs.com/hookjc/ 1. sed C代码 grep -rl matchstring somedir/ | xargs sed -i 's ...
- 在自定义目录下,按日期创建excel文件
在指定文件目录下,新建以当前日期命名的excel 文件,如果文件已经存在,在文件中新建一个sheet页来存放数据 import datetime import xlrd, xlwt import re ...
随机推荐
- 仿LOL项目开发第六天
仿LOL项目开发第六天 by草帽 OK,因为更新模块已经处理好了,接着开始登陆的编写.那么我们就需要状态机的管理. 所谓状态机就是在哪个状态执行那个状态的代码逻辑: 那么我们开始编写GameState ...
- 数学图形(1.19)Doppler spiral螺线
一种左右对称的螺线 相关软件参见:数学图形可视化工具,使用自己定义语法的脚本代码生成数学图形.该软件免费开源.QQ交流群: 367752815 vertices = t = *PI) to (*PI) ...
- Informatica 常用组件Source Qualifier之五 User Defined Join
User defined join : 输入用户定义的联接与输入自定义 SQL 查询类似.但是,只需输入 WHERE 子句的内容,而不是整个查询. 添加用户定义的联接时,源限定符转换包括默认 ...
- ASP.NET中使用TreeView显示文件
在ASP.NET中,TreeView的使用很普遍,把它利用上来 首先加入TreeView控件 <asp:TreeView ID="driverInfoView" runat= ...
- vue中的css作用域、vue中的scoped坑点
一.css作用域 之前一直很困扰css的作用域问题,即使是模块化编程下,在对应的模块的js中import css进来,这个css仍然是全局的.导致在css中需要加上对应模块的html的id/class ...
- [Grunt] Watch && grunt-contrib-watch
Watch is an essential component of any Grunt build, and you will find yourself using it in almost ev ...
- (笔试题)质数因子Prime Factor
题目: Given any positive integer N, you are supposed to find all of its prime factors, and write them ...
- ArcGIS Add-In调试无法重新生成
在调试ArcGIS Add-In时,出现错误:无法注册程序集"……\Projects\ArcGISAddIn\ArcGISAddIn\bin\Debug\ArcGISAddIn.dll&qu ...
- 使用System.getProperty方法,如何配置JVM系统属性 (转载)
很多时候需要在项目中读取外部属性文件,用到了System.getProperty("")方法.这个方法需要配置JVM系统属性,那么如何配置呢? 那就是使用java -D 配置系统属 ...
- 轻量级UIImageView分类缓存 库 AsyncImageView 使用
轻量级UIImageView分类缓存 库 AsyncImageView 使用 一: AsyncImageView 主页:https://github.com/nicklockwood/AsyncIma ...