1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

求助:datalife 6 伪静态化开启后错误,找不到页

本帖由 zmkmzmkm2007-08-02 发布。版面名称:源码讨论

  1. zmkmzmkm

    zmkmzmkm New Member

    注册:
    2007-05-14
    帖子:
    41
    赞:
    0
    如题,服务器的rewrite打开了,工作正常,datalife目录下 .htaccess 文件:
    DirectoryIndex index.php

    RewriteEngine On

    # 绣滂疱牝?
    RewriteRule ^page/(.*)$ index.php?cstart=$1 [L]
    # 燕?镱耱
    RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6 [L]
    RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5 [L]
    RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$ engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5 [L]
    RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4 [L]
    # 青 溴睃
    RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$ index.php?year=$1&month=$2&day=$3 [L]
    RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$ index.php?year=$1&month=$2&day=$3&cstart=$4 [L]
    # 青 忮顸 戾??
    RewriteRule ^([0-9]{4})/([0-9]{2})(/?)+$ index.php?year=$1&month=$2 [L]
    RewriteRule ^([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$ index.php?year=$1&month=$2&cstart=$3 [L]
    # 蔓忸?玎 忮顸 泐?
    RewriteRule ^([0-9]{4})(/?)+$ index.php?year=$1 [L]
    RewriteRule ^([0-9]{4})/page/([0-9]+)(/?)+$ index.php?year=$1&cstart=$2 [L]
    # 恹忸?潆 铗溴朦眍泐 屦?
    RewriteRule ^user/([^/]*)(/?)+$ index.php?subaction=userinfo&user=$1 [L]
    RewriteRule ^user/([^/]*)/page/([0-9]+)(/?)+$ index.php?subaction=userinfo&user=$1&cstart=$2 [L]
    # 恹忸?礤镳铟栩囗睇?耱囹彘
    RewriteRule ^newposts(/?)+$ index.php?subaction=newposts [L]
    RewriteRule ^newposts/page/([0-9]+)(/?)+$ index.php?subaction=newposts&cstart=$1 [L]
    # 羊囹桉蜩麇耜桢 耱疣龛鳆
    RewriteRule ^static/(.*).html(/?)+$ index.php?do=static&page=$1 [L]
    # 恹忸?桤狃囗睇?耱囹彘
    RewriteRule ^favorites(/?)+$ index.php?do=favorites [L]
    RewriteRule ^favorites/page/([0-9]+)(/?)+$ index.php?do=favorites&cstart=$1 [L]

    RewriteRule ^statistics.html$ index.php?do=stats [L]
    RewriteRule ^addnews.html$ index.php?do=addnews [L]
    RewriteRule ^rss.xml$ engine/rss.php [L]

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^.]+)/page/([0-9]+)(/?)+$ index.php?do=cat&category=$1&cstart=$2 [L]
    RewriteRule ^([^.]+)/?$ index.php?do=cat&category=$1 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^<]+)/rss.xml$ engine/rss.php?do=cat&category=$1 [L]
    RewriteRule ^page,([0-9]+),([^/]+).html$ index.php?do=static&page=$2&news_page=$1 [L]
    RewriteRule ^([^/]+).html$ index.php?do=static&page=$1 [L]


    我的pw论坛伪静态是正常的,datalife打开伪静态后,各个页面访问时,链接已经变成 .html形式,但提示404错误,找不到页,请问如何解决?谢谢。
     
  2. laogui

    laogui Administrator
    管理成员

    注册:
    2005-08-30
    帖子:
    15,216
    赞:
    35
    没玩过这程序,这个程序存在很多编码问题,不知道是不是这个原因
     
  3. zmkmzmkm

    zmkmzmkm New Member

    注册:
    2007-05-14
    帖子:
    41
    赞:
    0
    嗯,我用了英文语言包的。使用其它都还可以,目前就是这个伪静态没弄好,生成真正静态页由于没有详细资料,所以没敢弄,呵呵。
    我做的站:http://www.yyyqi.com/datalife/
     
  4. hahahaha78

    hahahaha78 New Member

    注册:
    2005-12-30
    帖子:
    180
    赞:
    3
    查看apache 配置,

    <Directory "/srv/www/htdocs">
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important. Please see
    # http://httpd.apache.org/docs-2.2/mod/core.html#options
    # for more information.
    Options SymLinksifOwnerMatch
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # Options FileInfo AuthConfig Limit
    AllowOverride All
    # Controls who can get stuff from this server.
    Order allow,deny
    Allow from all
    </Directory>

    找到上面这一段并改成这样,Options 段的参数你可一个一个试试,看哪个合适
     
  5. zmkmzmkm

    zmkmzmkm New Member

    注册:
    2007-05-14
    帖子:
    41
    赞:
    0
    呵呵,太棒了,依照 小猪 的提示,修改 红色部分, httpd.conf 文件保存,重新启动apache,DL里设置好启用伪静态,一切正常了。太高兴了。
    再次感谢性感小肥猪了!!!!