youBBS安装vps rewrit版本后,除首页全部404错误的解决办法

youbbs是一个很简洁方便的轻论坛程序,官方说是借鉴了v2ex,本人一直很喜欢这样的风格,所以今天就安装试了一下。

youBBS - u社区

 

大致步骤,https://code.google.com/p/youbbs/downloads/list 下载vps rewrite 版youbbs

然后进解压包配置好config.php文件【数据库账号 密码 名称 端口(端口默认的可以不改)】,上传,然后www.domain.com/install.php即可安装成功【www.domain.com填写你自己的域名】

第一个注册的账号默认为管理员账号。

但是呢,我遇到了这样的问题,安装好后,除了首页,其他的页面均404,后来发现是rewrite规则没有写好【.htaccess 或者.conf】

404错误只针对少数人【如我这种装AMH只支持.conf不支持.htaccess的,一般人开rewrite,youbbs自带有.htaccess,正常是不会出现404的】

于是找了一下,用以下的规则,可以完美解决404问题:

rewrite ^/n-([0-9]+)(-([0-9]*))?$ /nodepage.php?cid=$1&page=$3 last;
rewrite ^/t-([0-9]+)(-([0-9]*))?$ /topicpage.php?tid=$1&page=$3 last;
rewrite ^/notifications$ /notifications.php last;
rewrite ^/feed$ /feed.php last;
rewrite ^/forgot$ /forgot.php last;
rewrite ^/upload-(650|590)$ /upload.php?mw=$1 last;
rewrite ^/viewat-(desktop|mobile)$ /viewat.php?via=$1 last;
rewrite ^/goto-t-([0-9]+)$ /gototopic.php?tid=$1 last;
rewrite ^/member/(.+)$ /member.php?mid=$1 last;
rewrite ^/newpost/([0-9]+)$ /newpost.php?cid=$1 last;
rewrite ^/admin-edit-post-([0-9]+)$ /admin-edit-post.php?tid=$1 last;
rewrite ^/admin-edit-comment-([0-9]+)$ /admin-edit-comment.php?rid=$1 last;
rewrite ^/admin-setuser-([0-9]+)$ /admin-setuser.php?mid=$1 last;
rewrite ^/admin-node(-([0-9]*))?$ /admin-node.php?nid=$2 last;
rewrite ^/admin-setting$ /admin-setting.php last;
rewrite ^/admin-user-([a-z]+)(-([0-9]*))?$ /admin-user.php?act=$1&mid=$3 last;
rewrite ^/admin-link-([a-z]+)(-([0-9]*))?$ /admin-link.php?act=$1&lid=$3 last;
rewrite ^/(login|sigin|logout|forgot|setting|install)$ /$1.php last;
rewrite ^/.*?templates /404.html last;
rewrite ^/.*?avatar/$ /404.html last;
rewrite ^/upload/([0-9]+/)?$ /404.html last;
rewrite ^/.*?avatar/(large|normal|mini)/$ /404.html last;
rewrite ^/favorites$ /favorites.php last;

大功告成~

  • 通告关闭
  • 评论 (14)
  1. 这界面倒是挺有爱的,做个问答倒也挺不错的~

    • 问答有问答的程序。。。不过这个做个内部交流论坛蛮好的~

  2. 挺不错的问答程序

    • 这个是论坛,不是问答程序!

  3. 关注过。不知道拿来干嘛~

    • 内部论坛是最好的选择~

  4. youBBS,好多的论坛程序啊

    • Android
    • 8月 14th. 2013 3:15下午

    ………不玩论坛….论坛不好玩……..

    • 免费资源部落
    • 8月 14th. 2013 10:07下午

    有点像问答。

    • 我倒觉得有的像vinilla

  5. 代码质量方面没有 bbPress 高,功能没有 Discuz 全,用它干什么?

  6. 想不起来怎么用

  7. 不错不错

评论关闭

回到顶部~