由于cn域名不太保险,规则胡乱变化,不敢用了,就重新注册了个duduyu.net,已经通过备案了,duduyu.net会重定向到此域名,以前的链接也不会失效,301弄了半天不生效原来是加错位置了,得加到开头,我把我的代码发上来给大家看看吧,也许不够精简,但是实现了我想要的效果,请各位朋友帮忙修改下友情链接地址为www.duduyu.net。
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
rewritecond %{http_host} ^www.duduyu.net [nc]
rewriterule ^(.*)$ http://www.duduyu.net/$1 [L,R=301]
RewriteCond %{http_host} ^duduyu.net [NC]
RewriteRule ^(.*)$ http://www.duduyu.net/$1 [L,R=301]
RewriteCond %{http_host} ^duduyu.net [NC]
RewriteRule ^(.*)$ http://www.duduyu.net/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule># END WordPress