apache开启伪静态

在虚拟主机加入如下:

<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{QUERY_STRING} ^(.*)$
        RewriteRule ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2&%1
        RewriteCond %{QUERY_STRING} ^(.*)$
        RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3&%1
        RewriteCond %{QUERY_STRING} ^(.*)$
        RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&%1
        RewriteCond %{QUERY_STRING} ^(.*)$
        RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&%1
        RewriteCond %{QUERY_STRING} ^(.*)$
        RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3&%1
        RewriteCond %{QUERY_STRING} ^(.*)$
        RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3&%1
        RewriteCond %{QUERY_STRING} ^(.*)$
        RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3&%1
        RewriteCond %{QUERY_STRING} ^(.*)$
        RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3&%1
        RewriteCond %{QUERY_STRING} ^(.*)$
        RewriteRule ^(.*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ $1/plugin.php?id=$2:$3&%1
</IfModule>
View Code

 

如果要开启第三方平台伪静态,需设置:

然后在第三方平台后台开启伪静态

(discuz:全局->seo设置->URL静态化)

posted @ 2016-03-22 19:22  沐风先生  阅读(152)  评论(0编辑  收藏  举报