2013-01-24 39 views
1

我希望能夠使用htaccess更改根目錄。我希望能夠使用htaccess更改根目錄

我想這一點:

index.php/user/user_postdetail/index/14

要成爲這樣的:

index.php/post_14.html

我嘗試使用

RewriteRule post_([0-9]+).html$ /index.php/user/user_postdetail/index/$1 [L=301,R] 

但我得到它扭轉。有任何想法嗎?

+0

的index.php/post_14.html這裏的14號是動態的。確切的頁面是index.php/user/user_postdetail/index/14。這個頁面必須重定向到index.php/post_14.html – sreelatha

回答

0

您有一個錯字。它應該是R=301,因爲它代表R用301代碼進行轉接,而L表示L要調用的規則。

此外,你有它倒退。

你需要的是:

RewriteRule user_postdetail/index/([0-9]+)$ /index.php/post_$1 [R=301,L] 
相關問題