Apache htaccess 重写假设文件存在!
2016-01-30 13:11
513 查看
假设文件 data/cache/index.html 存在。那么才重写。
否则使用默认的MVC 重写。by default.fu@foxmail.com
—————————————————————增强版 正则文件存在就重写 by default.fu@foxmail.com———————————————————
否则使用默认的MVC 重写。by default.fu@foxmail.com
RewriteEngine on RewriteCond %{DOCUMENT_ROOT}/data/cache/list_1.html -f RewriteRule ^game\/? $ data/cache/list_1.html [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d #RewriteRule ^(.*)$ index.php/$1 [PT,QSA,L] RewriteRule ^(.*)$ index.php?/$1 [PT,QSA,L]
—————————————————————增强版 正则文件存在就重写 by default.fu@foxmail.com———————————————————
RewriteEngine on RewriteCond %{DOCUMENT_ROOT}/demo/cache/game_$1.html -f RewriteRule ^game\/(\d+)\/?$ cache/game_$1.html [L] RewriteCond %{DOCUMENT_ROOT}/demo/cache/game.html -f RewriteRule ^game\/?$ cache/game.html [L]
相关文章推荐
- Apache Kylin 部署之不完全指南
- SparkStreaming运行出现 java.lang.NoClassDefFoundError: org/apache/htrace/Trace 错误
- apache commons io 提案
- 重启Apache报错apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName ... waiting的解决方法
- Ubuntu下开启Apache重写扩展
- Apache OFBiz技术架构
- apache kafka监控系列-KafkaOffsetMonitor
- apache的开源工具common-fileupload实现文件上传和下载
- Apache Rewrite规则详解
- apache commons io 未来任务与展望
- Apache Spark Jobs 性能调优(二)
- 如何设置Apache中的最大连接数
- Apache Spark Jobs 性能调优(一)
- Java Code Examples for org.apache.commons.codec.binary.Base64InputStream
- Apache配置实现日志按天分割并删除指定几天前的日志
- Manual install on Windows 7 with Apache and MySQL
- Apache Shiro 使用手册(五)Shiro 配置说明
- (转)网站隔几天打不开,多次重启Apache解决办法
- Apache Commons工具集简介
- Apache shiro 文章推荐