私は次のようなURLを持っています
"www.site.com/index.php/details/productname"
codeigniter のそのリンクで 404 エラーが発生しますが、URL www.site.com/index.php/details/ は正常に機能しています。私はseoの方法でurlパラメータを処理したい。
私は次のようなURLを持っています
"www.site.com/index.php/details/productname"
codeigniter のそのリンクで 404 エラーが発生しますが、URL www.site.com/index.php/details/ は正常に機能しています。私はseoの方法でurlパラメータを処理したい。
/index/
URL の一部にセグメント
を追加する必要があります。http://www.site.com/index.php/details/index/productname/
そのようなURLを開きたい場合http://www.site.com/index.php/details/productname/
:
1) メソッドを定義する必要があります_remap()
:
public function _remap($method)
{
if ($method == 'index')
{
$this->viewDetails($this->uri->segment(2));
}
else
{
$this->default_method();
}
}
また
2)application/config/routes.php
ファイルを使用
$route['details/(:any)'] = "products/viewDetails/$1";
ユーザーガイドから: