codeigniter:路由中的URL问题

时间:2018-07-18 14:10:36

标签: php codeigniter

我对产品网址有疑问,我希望它没有任何前缀。我的代码是:-

$route['default_controller'] = 'home';
$route['404_override'] = 'help';      //  Controller for 404
$route['translate_uri_dashes'] = TRUE;

$route["index.html"]='home/index';          // Working Fine
$route["about.html"]='home/about';          // Working Fine
$route["products.html"]='home/products';    // Working Fine

$route['category/(:any).html'] = "home/category/$1";  // WORKING FINE 
FUNCTION category() in cntroller Home 

// PROBLEM WITH  PRODUCT URL LIKE www.example.com/product1.html

$route['(:any).html'] = "category/$1";  // HOW TO CALL CONTROLLER NAMED 
Category to find desired url.

//note  : I want 404 page working to

0 个答案:

没有答案