# 二级栏目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静态规则
RewriteRule ^(.*)/c-([0-9]+)\.html$ $1/index\.php\?category/view/$2.html
RewriteRule ^(.*)/l-([0-9]+)\.html$ $1/index\.php\?category/list/$2.html
RewriteRule ^(.*)/r-([0-9]+)\.html$ $1/index\.php\?category/recommend/$2.html
RewriteRule ^(.*)/q-([0-9]+)\.html$ $1/index\.php\?question/view/$2.html
RewriteRule ^(.*)/u-([0-9]+)\.html$ $1/index\.php\?user/space/$2.html
RewriteRule ^(.*)/us-([0-9]+)\.html$ $1/index\.php\?user/scorelist/$2.html
RewriteRule ^(.*)/c-([0-9]+)/([0-9]+)\.html$ $1/index\.php\?c-$2/$3.html
RewriteRule ^(.*)/c-([0-9]+)/all/([0-9]+)\.html$ $1/index\.php\?c-$2/all/$3.html
RewriteRule ^(.*)/c-([0-9]+)/all\.html$ $1/index\.php\?c-$2/all\.html
RewriteRule ^(.*)/c-([0-9]+)/([0-9]+)/([0-9]+)\.html$ $1/index\.php\?c-$2/$3/$4.html
RewriteRule ^(.*)/c-([0-9]+)/([0-9]+)\.html$ $1/index\.php\?c-$2/$3.html
RewriteRule ^(.*)/l-([0-9]+)/([0-9]+)\.html$ $1/index\.php\?l-$2/$3.html
RewriteRule ^(.*)/u-([0-9]+)\.html$ $1/index\.php\?u-$2.html
RewriteRule ^(.*)/r-([0-9]+)\.html$ $1/index\.php\?r-$2.html
RewriteRule ^(.*)/gift\.html$ $1/index\.php\?gift.html
RewriteRule ^(.*)/user/ask\.html$ $1/index\.php\?user/ask.html
RewriteRule ^(.*)/user/answer\.html$ $1/index\.php\?user/answer.html
RewriteRule ^(.*)/user/favorite\.html$ $1/index\.php\?user/favorite.html
RewriteRule ^(.*)/message/new\.html$ $1/index\.php\?message/new.html
RewriteRule ^(.*)/user/score\.html$ $1/index\.php\?user/score.html
RewriteRule ^(.*)/question/add\.html$ $1/index\.php\?question/add.html