黄聪:WordPress独立IP虚拟主机修改.htaccess文件URL301重定向成功!

今天终于把自己博客的URL 301重定向做好了。真是费尽波折啊。

本人博客为http://www.isyeo.com/

原本URL格式为 http://www.isyeo.com/a/b/

先301到 http://www.isyeo.com/a/b.html

最后经过配置 .htaccess 文件成功重定向,格式如下:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine
On
RewriteBase
/
RewriteRule
^index\.php$ - [L]
RewriteRule
^(.*)/(.*)/$ $1/$2.html [R=301,L]
RewriteCond %{REQUEST_FILENAME} !
-f
RewriteCond %{REQUEST_FILENAME} !
-d
RewriteRule .
/index.php [L]
</IfModule>
#
END WordPress

原文地址:https://www.cnblogs.com/huangcong/p/2015812.html