# 二级栏目301重定向到二级域名方法,如将http://www.17hdy.com/bbs/重定向http://bbs.17hdy.com
- RewriteCond %{http_host} ^17hdy.com [NC]
- RewriteRule ^(.*)$ http://www.17hdy.com/$1 [L,R=301]
- # Protect httpd.ini and httpd.parse.errors files
- # from accessing through HTTP
- RewriteRule ^(.*)/bbs/(.*)$ $1/bbs/301\.php\?go=$2 [L]
# 301.php文件内容
<?php
$go=$_GET['go'];//获取跳转页面链接部分,如"thread-112-1.html",又如forum.php?fid=32等
header("HTTP/1.1 301 Moved Permanently");//发送301状态,之后的所有跳转均为301
header('location:http://bbs.17hdy.com/'.
# tipask静态规则
#DX2.0静态规则
<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 ^(.*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3&%1
</IfModule>