2016-07-01 36 views
0

我對WordPress的一個博客,從博客遷移等有固定鏈接結構類似http://www.exeideas.com/2014/10/blogger-to-wordpress-best-htaccess-file.html,但現在我要重寫它作爲唯一的http://www.exeideas.com/blogger-to-wordpress-best-htaccess-file刪除/年/月/從固定鏈接使用的.htaccess

我在我的.htaccess文件中嘗試了以下代碼,但沒有任何發生。

## Remove /YEAR/MONTH/ From URLs ## 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteRule ^/[0-9]{4}/[0-9]{2}/([^/.]+)\.html$ http://www.exeideas.com/$1/ [L,R=301] 
</IfModule> 
## Remove /YEAR/MONTH/ From URLs ## 

## Remove /YEAR/MONTH/ From URLs ## 
RedirectMatch 301 ^/[0-9]{4}/[0-9]{2}/([^/.]+)\.html$ http://www.exeideas.com/$1/ 
## Remove /YEAR/MONTH/ From URLs ## 

所以,你能解釋一下我身後的代碼或其他任何正在發生的錯誤... ???

回答

0

只要從重寫規則的模式

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteRule ^[0-9]{4}/[0-9]{2}/([^.]+)\.html$ http://www.exeideas.com/$1/ [L,R=301] 
</IfModule> 
+0

不工作取下斜線... :-( –