这个说来简单,但是还是要记一下的。尤其是wordpress开启了固定链接,本身已经有个.htaccess文件了。在加入转向代码时就要注意顺序,要把转向链接放在前面。我是从pggdt.mypressonline.com转到ft.wupo.info的,整个.htaccess文件内容如下:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^pggdt.mypressonline.com [NC]
RewriteRule ^(.*)$ http://ft.wupo.info/$1 [L,R=301]
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress