自己写的.htaccess规则

之前写了一篇给新改版的论坛进行seo优化

现在进行继续优化。。

之前要301转向都是去搜索别人写好的规则,今天我终于也会自己写简单的了。。

这样就不会被动。

我查找了相关资料,看了一些规律就让我写出了两个小规则。

现在分享给大家,希望大家举一反三。

[code]
RewriteEngine On
RewriteRule ^(.*)-t([0-9]+)\.html http://forum.cityofsteam.com/index.php?topic=$2.0 [R=301]
RewriteRule ^topic([0-9]+)\.html http://forum.cityofsteam.com/index.php?topic=$1.0 [R=301]
RewriteRule ^topic([0-9]+)-([0-9]+)\.html http://forum.cityofsteam.com/index.php?topic=$1.$2 [R=301]
[/code]

这是我写的代码。

这是我在site网站的时候看到谷歌收录了比较多的这样的链接:

forum.cityofsteam.com/topic493.html

于是我想到了用.htaccess自己写一个规则让他301.

大家自己看看其中的规律吧。很简单。

我是参考:

[code]
RewriteCond %{HTTP_HOST} !^www.oxiao.com$ [NC]
RewriteRule ^(.*)$ http://www.oxiao.com/$1 [L,R=301]
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
[/code]

和这篇文章:http://zhidao.baidu.com/question/129024355.html?fr=qrl&index=2

希望对大家有用。想继续深入学习的我看应该要去看下正则表达式。!