• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting 404 for rewrite new URL rule

#1
I define the URL structure 

Code:
example.com/controller_name/method_name/product_id

, I want URL structure would be 

Code:
example.com/product_name

 but I am getting 404 error when trying to write 

Code:
example.com/product_name

 or 

Code:
example.com/category_name

I am trying to write 
Code:
$route['(:any)/([a-zA-Z0-9]+)'] = '/products/details/$1';

 but its giving 404 error.


Already defined following code and its working fine:
Code:
$route['(:any)'] = 'pages/view/$1';

 

Code:
$route['categories/posts/(:any)'] = 'category/posts/$1';

Code:
$route['categories/delete/(:any)'] = 'category/delete/$1';
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.