微信和手机QQ在我们传播链接时喜欢加点参数,
因此导致一种特殊组合会出现404,
也就是博主在用的Lighttpd+Discuz+伪静态。
例如访问http://www.zuimc.com/thread-21945-1-1.html是正常的,访问http://www.zuimc.com/thread-21945-1-1.html?xxx就变成了404,
挖掘了一下发现是因为网络上传播的Lighttpd-Discuz伪静态写法判定有问题,html后还有内容的话,将不会进行重写。
改成这样既可:
1 2 3 4 5 6 7 8 9 10 11 |
url.rewrite-if-not-file = ( "^(.*)/topic-(.+)\.html(.*)$" => "$1/portal.php?mod=topic&topic=$2", "^(.*)/article-([0-9]+)-([0-9]+)\.html(.*)$" => "$1/portal.php?mod=view&aid=$2", "^(.*)/forum-(\w+)-([0-9]+)\.html(.*)$" => "$1/forum.php?mod=forumdisplay&fid=$2&page=$3", "^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html(.*)$" => "$1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3", "^(.*)/group-([0-9]+)-([0-9]+)\.html(.*)$" => "$1/forum.php?mod=group&fid=$2&page=$3", "^(.*)/space-(username|uid)-(.+)\.html(.*)$" => "$1/home.php?mod=space&$2=$3", "^(.*)/blog-([0-9]+)-([0-9]+)\.html(.*)$" => "$1/home.php?mod=space&uid=$2&do=blog&id=$3", "^(.*)/(fid|tid)-([0-9]+)\.html(.*)$" => "$1/index.php?action=$2&value=$3", "^(.*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html(.*)$" => "$1/plugin.php?id=$2:$3" ) |