簡體   English   中英

.htaccess縮短代碼不起作用

[英].htaccess shortening code not working

我想將http://fpmls.ca/index.php/user/user_postdetail/index/14縮短為http://fpmls.ca/index.php/post_14.html

user_postdetail是一個控制器,索引是這個控制器的功能14是id(dynamic)

我的.htaccess代碼是:

RewriteEngine On           
RewriteRule ^post_([0-9]+).html$ index.php/user/user_postdetail/index/$1

我正在獲取URL,但是“找不到404頁面:未找到您請求的頁面”。 顯示在該頁面上。 有人請幫我

使用配置目錄中的routes.php ,定義以下規則:

$route['post_(:num).html'] = 'user/user_postdetail/$1';

或者,您可以省略.html並在應用程序的配置中添加URI后綴。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM