用哪个版本?
若方便发个网址看看

ego008 at 2013-04-21 21:12:40
1

@ego008 http://www.wpcnz.com 1 用的独立VPS不带缓存版

ray1980 at 2013-04-21 21:17:45
2

修改.htaccess 增加对格式 /topic/1/1 解析

把评论页数修改为 /topic/1-1 格式

ego008 at 2013-04-21 21:32:38
3

@ego008 用的是nginx,不知道/topic/1/1,对应的是哪个地址

ray1980 at 2013-04-21 21:45:11
4

@ray1980 这里有一个 http://youbbs.sinaapp.com/t/201
我照葫芦画瓢,不知行不行
rewrite ^/topic/([0-9]+)(/([0-9]*))?$ /topicpage.php?tid=$1&page=$3 last;

ego008 at 2013-04-21 21:48:30
5

这是我的配置文件,里面有这一条
location /
{

rewrite ^/node/([0-9]+)(/([0-9]*))?$ /nodepage.php?cid=$1&page=$3 last;

rewrite ^/topic/([0-9]+)(/([0-9]*))?$ /topicpage.php?tid=$1&page=$3 last;

rewrite ^/page/([0-9]+)$ /indexpage.php?page=$1 last;

rewrite ^/notifications$ /notifications.php last;

rewrite ^/favorites$ /favorites.php last;

rewrite ^/qqlogin$ /qqlogin.php last;

rewrite ^/qqcallback$ /qqcallback.php last;

rewrite ^/qqsetname$ /qqsetname.php last;

rewrite ^/wblogin$ /wblogin.php last;

rewrite ^/wbcallback$ /wbcallback.php last;

rewrite ^/wbsetname$ /wbsetname.php last;

rewrite ^/feed$ /feed.php last;

rewrite ^/robots.txt$ /robots.php last;

rewrite ^/sitemap-([0-9]+)$ /sitemap.php?id=$1 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;

ray1980 at 2013-04-21 21:50:24
6

修改试一下
rewrite ^/topic/([0-9]+)(\/([0-9]*))?$ /topicpage.php?tid=$1&page=$3 last;
rewrite ^/topic/([0-9]+)/?([0-9]*)$ /topicpage.php?tid=$1&page=$2 last;

ego008 at 2013-04-21 21:55:15
7

@ego008 两条?用哪一条?

ray1980 at 2013-04-21 21:57:37
8

@ray1980 我没环境测试,看哪个行,不行再微调。
目前
rewrite ^/topic/([0-9]+)(/([0-9]*))?$ /topicpage.php?tid=$1&page=$3 last;
能打开 /topic/1-1 的格式

ego008 at 2013-04-21 22:00:58
9

@ego008 谢谢大神 用了这条就解决了
rewrite ^/topic/([0-9]+)(\/([0-9]*))?$ /topicpage.php?tid=$1&page=$3 last;

能跳转到 topic/77#new-comment

谢谢!

ray1980 at 2013-04-21 22:05:59
10
登录 后发表评论