muban大师 发表于 2018-12-13 14:52:04

Dedecms设置伪静态(不修改文件)的方法

本规则适合新站,当然搜索引擎没收录的也比较适合,因为会修改文章地址,已经收录的你可能需要修改下规则
       
        请先确认你的主机支持“.htaccess或httpd.ini”
       
        Linux系统一般为.htaccess
        windows系统一般为httpd.ini
        不清楚的咨询IDC
       
        支持httpd.ini的下载附件或复制下面的代码命名为httpd.ini放置到根目录
        支持.htaccess的下载附件或复制下面的代码命名为.htaccess放置到根目录
       
        ----------------------------------------------------------------------
        系统设置-核心设置 是否使用伪静态:打开
        进入网站栏目管理-文件保存目录:{cmspath}/html
        默认页的名称:栏目ID.html 注:栏目ID在网站栏目管理的栏目名称哪能看到
        高级选项-文章命名规则:{typedir}/view{aid}.html
        列表命名规则:{typedir}/{tid}_{page}.html
        ---------------------------------------------------------------
        OK完毕,然后发表文章,这是同样会生成html 只要你定期清理生成的html文件就行了,不会影响访问
       
        httpd.ini
       
        [ISAPI_Rewrite,
        # 3600 = 1 hour
        CacheClockRate 3600
       
        RepeatLimit 32
        # Protect httpd.ini and httpd.parse.errors files
        # from accessing through HTTP
       
        RewriteRule ^/show/([0-9,+)\.html(&page=([0-9,+))?$ /plus/list\.php\?tid=$1&page=$2
        RewriteRule ^(.*)/plus/list-([0-9,+)-([0-9,+)-([0-9,+)\.html\?*(.*)$ $1/plus/list\.php\?tid=$2&TotalResult=$3&PageNo=$4&$5
        RewriteRule ^/show/rizhi([0-9,+)\.html(&page=([0-9,+))?$ /plus/view\.php\?aid=$1&page=$2 [L,
       
        .htaccess (未测试,不过应该没问题)
       
       
       
        # 将 RewriteEngine 模式打开
        RewriteEngine On
        RewriteBase /
        # Powered by Sevenay
        RewriteRule ^/html/(.+)\.html$ /plus/list.php?tid=$1
        RewriteRule ^/plus/list-([0-9,+)-([0-9,+)-([0-9,+)\.html$ /plus/list.php?tid=$1&TotalResult=$2&PageNo=$3
        RewriteRule ^/html/view(.+)\.html$ /plus/view.php?aid=$1
页: [1]
查看完整版本: Dedecms设置伪静态(不修改文件)的方法