V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
atie
V2EX  ›  Linux

有人会重写url规则吗?nginx的~~discuz程序。

  •  
  •   atie · 2013-04-16 22:24:17 +08:00 · 3037 次点击
    这是一个创建于 4025 天前的主题,其中的信息可能已经有所发展或是发生改变。
    disucz默认的规则是
    http://www.xxx.com/forum-57-1.html
    改成http://www.xxx.com/forum/57/1/

    http://www.xxx.com/thread-142469-1-1.html
    改成http://www.xxx.com/thread/142469/1/1.html

    在nginx下,disucz程序,有人会改吗?
    3 条回复    1970-01-01 08:00:00 +08:00
    feiandxs
        1
    feiandxs  
       2013-04-16 22:27:07 +08:00
    rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
    rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;

    原始规则。

    - to /
    MrTwo
        2
    MrTwo  
       2013-04-16 23:07:26 +08:00
    discuz的伪静态要更改,好像不仅仅要改.htaccess的规则,也要改某个Php文件的配置。
    aisin
        3
    aisin  
       2013-04-16 23:20:10 +08:00
    我的vps当初也是不会整nginx的伪静态, 所以干脆在vps搭建了apache环境, 这样写htaccess就简单些了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4056 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 05:28 · PVG 13:28 · LAX 22:28 · JFK 01:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.