知行社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 2712|回复: 1
收起左侧

Discuz X! 2 for SAE 伪静态实现

[复制链接]
script 发表于 2012-1-11 22:29 | 显示全部楼层 |阅读模式
编辑config.yaml文件,写入如下rewrite规则:
---
name: hongloum
version: 1
...
handle:
-rewrite: if ( path ~ "^topic-(.+)\.html$") goto "portal.php?mod=topic&topic=$1&%{QUERY_STRING}"
-rewrite: if ( path ~ "^article-([0-9]+)-([0-9]+)\.html$") goto "portal.php?mod=view&aid=$1&page=$2&%{QUERY_STRING}"
-rewrite: if ( path ~ "^forum-(\w+)-([0-9]+)\.html$") goto "forum.php?mod=forumdisplay&fid=$1&page=$2&%{QUERY_STRING}"
-rewrite: if ( path ~ "^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$") goto "forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%{QUERY_STRING}"
-rewrite: if ( path ~ "^group-([0-9]+)-([0-9]+)\.html$") goto "forum.php?mod=group&fid=$1&page=$2&%{QUERY_STRING}"
-rewrite: if ( path ~ "^space-(username|uid)-(.+)\.html$") goto "home.php?mod=space&$1=$2&%{QUERY_STRING}"
-rewrite: if ( path ~ "^([a-z]+)-(.+)\.html$") goto "$1.php?rewrite=$2&%{QUERY_STRING}"
-rewrite: if ( path ~ "^data/cache/(.+)\.css") goto "cssjs.php?file=$1&type=css"
-rewrite: if ( path ~ "^data/cache/(.+)\.js") goto "cssjs.php?file=$1&type=js"
 楼主| script 发表于 2012-1-11 22:31 | 显示全部楼层
  1. ---
  2. name: hongloum
  3. version: 1
  4. ...
  5. handle:
  6. -rewrite: if ( path ~ "^topic-(.+)\.html$") goto "portal.php?mod=topic&topic=$1&%{QUERY_STRING}"
  7. -rewrite: if ( path ~ "^article-([0-9]+)-([0-9]+)\.html$") goto "portal.php?mod=view&aid=$1&page=$2&%{QUERY_STRING}"
  8. -rewrite: if ( path ~ "^forum-(\w+)-([0-9]+)\.html$") goto "forum.php?mod=forumdisplay&fid=$1&page=$2&%{QUERY_STRING}"
  9. -rewrite: if ( path ~ "^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$") goto "forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%{QUERY_STRING}"
  10. -rewrite: if ( path ~ "^group-([0-9]+)-([0-9]+)\.html$") goto "forum.php?mod=group&fid=$1&page=$2&%{QUERY_STRING}"
  11. -rewrite: if ( path ~ "^space-(username|uid)-(.+)\.html$") goto "home.php?mod=space&$1=$2&%{QUERY_STRING}"
  12. -rewrite: if ( path ~ "^([a-z]+)-(.+)\.html$") goto "$1.php?rewrite=$2&%{QUERY_STRING}"
  13. -rewrite: if ( path ~ "^data/cache/(.+)\.css") goto "cssjs.php?file=$1&type=css"
  14. -rewrite: if ( path ~ "^data/cache/(.+)\.js") goto "cssjs.php?file=$1&type=js"
复制代码

QQ|小黑屋|手机版|知行技术社区 ( 湘ICP备11020288号-1 )

GMT+8, 2020-9-28 07:18 , Processed in 0.018990 second(s), 10 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表