在网站根目录下新建一个.htaccess文件即可,编辑如下 RewriteEngine OnRewriteRule ^index.html$ index.phpRewriteRule ^game.html$ game.phpRewriteRule ^news-([0-9]+).html$ news.php?id=$1RewriteRule ^news-([0-9]+)-p([0-9]+).html$ news.php?id=$1&page=$2RewriteRule ^content-([0-9]+).html$ content.php?id=$1RewriteRule ^content-([0-9]+)-([0-9]+).html$ content.php?id=$1&page=$2RewriteRule ^c/([A-Za-z0-9_]+).html$ game.php?action=guildstart&myworld=$1RewriteRule ^user.html$ user.phpRewriteRule ^pay.html$ pay.phpRewriteRule ^card.html$ card.phpRewriteRule ^reg.html$ reg.phpRewriteRule ^about.html$ about.phpRewriteRule ^login.html$ login.php #discuz 3.3伪静态规则RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html$ $1/archiver/index.php?action=$2&value=$3&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^(.*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ $1/plugin.php?id=$2:$3&%1
时间: 2024-11-04 11:19:19