zoukankan      html  css  js  c++  java
  • Apache htaccess 重写假设文件存在!

    假设文件 data/cache/index.html 存在。那么才重写。

    否则使用默认的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]
    

  • 相关阅读:
    gotour源码阅读
    CPU知识
    GCC知识
    go/src/make.bash阅读
    Go的pprof使用
    CGI的一些知识点
    STM32——C语言数据类型
    css 学习资料
    项目管理实践教程
    js 格式验证总结
  • 原文地址:https://www.cnblogs.com/bhlsheji/p/5170885.html
Copyright © 2011-2022 走看看