Advertisement
Guest User

Untitled

a guest
Aug 21st, 2014
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.04 KB | None | 0 0
  1. <?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2. /*
  3. | -------------------------------------------------------------------------
  4. | URI ROUTING
  5. | -------------------------------------------------------------------------
  6. | This file lets you re-map URI requests to specific controller functions.
  7. |
  8. | Typically there is a one-to-one relationship between a URL string
  9. | and its corresponding controller class/method. The segments in a
  10. | URL normally follow this pattern:
  11. |
  12. |   example.com/class/method/id/
  13. |
  14. | In some instances, however, you may want to remap this relationship
  15. | so that a different class/function is called than the one
  16. | corresponding to the URL.
  17. |
  18. | Please see the user guide for complete details:
  19. |
  20. |   http://codeigniter.com/user_guide/general/routing.html
  21. |
  22. | -------------------------------------------------------------------------
  23. | RESERVED ROUTES
  24. | -------------------------------------------------------------------------
  25. |
  26. | There area two reserved routes:
  27. |
  28. |   $route['default_controller'] = 'welcome';
  29. |
  30. | This route indicates which controller class should be loaded if the
  31. | URI contains no data. In the above example, the "welcome" class
  32. | would be loaded.
  33. |
  34. |   $route['404_override'] = 'errors/page_missing';
  35. |
  36. | This route will tell the Router what URI segments to use if those provided
  37. | in the URL cannot be matched to a valid route.
  38. |
  39. */
  40.  
  41. $route['default_controller'] = "main";
  42. $route['404_override'] = '';
  43.  
  44.  
  45. /// URI like '/en/about' -> use controller 'about'
  46. $route['^(en|ar)/(.+)$'] = "$2";
  47.  
  48. // '/en', '/de', '/fr' and '/nl' URIs -> use default controller
  49. $route['^(en|ar)$'] = $route['default_controller'];
  50. $route['view/:any'] = 'poem/view/$1';
  51. $route['products/([a-z]+)/(\d+)'] = "$1/id_$2";  //products/shirts/123    shirts/id_123
  52. $route['poem/:any']= 'poem/view/$1';
  53. $route['product/(:num)'] = "category/view/$1";
  54.  
  55. /* End of file routes.php */
  56. /* Location: ./application/config/routes.php */
  57.  
  58.  
  59. /* End of file routes.php */
  60. /* Location: ./application/config/routes.php */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement