网站伪静态和301重定向的设置方法

2009年12月21日 学习资料 网站伪静态和301重定向的设置方法已关闭评论 阅读 1,637 次

这个是我的博客和论坛的相关伪静态以及301重定向的设置。
在根目录下编辑.htaccess文件内容如下:

# 将 RewriteEngine 模式打开
RewriteEngine On
# Rewrite 定义各重写规则
RewriteRule ^archiver/((fid|tid)-[\w\-]+\.html)$ archiver/index.php?$1
RewriteRule ^forum-([0-9]+)-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ viewthread.php?tid=$1&extra=page\%3D$3&page=$2


RewriteRule ^space-(username|uid)-(.+)\.html$ space.php?$1=$2
RewriteRule ^tag-(.+)\.html$ tag.php?name=$1

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^dxztc.com [nc]
rewriterule ^(.*)$ http://www.dxztc.com/$1 [r=301,nc]

redirect 301 /bbs http://bbs.dxztc.com

redirect 301 /uchome http://home.dxztc.com

评论已关闭!