天天看點

WEB服務的域名301重定向,獨立IP虛拟主機修改.htaccess檔案BEGIN WordPressEND WordPress

今天終于把網站的URL 301重定向做好了。真是費盡波折啊。

網站為

https://www.mobangwang.com/ 原本URL格式為 https://www.mobangwang.com/a/b/ 先301到 https://www.mobangwang.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