From 48d6d5856ea95dd363f2a420f08200f488fb5151 Mon Sep 17 00:00:00 2001
From: Razican
$route['404_override'] = '';
+
+This route indicates which controller class should be loaded if the requested controller is not found. It will override the default 404 +error page. It won't affect to the show_404() function, which will continue loading the default error_404.php file at application/errors/error_404.php.
+Important: The reserved routes must come before any wildcard or regular expression routes.
-- cgit v1.2.3-24-g4f1b From 114ab0988e20ac6be39ad363ff897a1a3b85e565 Mon Sep 17 00:00:00 2001 From: RazicanRouting rules are defined in your application/config/routes.php file. In it you'll see an array called $route that +
Routing rules are defined in your application/config/routes.php file. In it you'll see an array called $route that permits you to specify your own routing criteria. Routes can either be specified using wildcards or Regular Expressions
@@ -90,7 +90,7 @@ permits you to specify your own routing criteria. Routes can either be specified$route['product/:num'] = "catalog/product_lookup";
-In a route, the array key contains the URI to be matched, while the array value contains the destination it should be re-routed to. +
In a route, the array key contains the URI to be matched, while the array value contains the destination it should be re-routed to. In the above example, if the literal word "product" is found in the first segment of the URL, and a number is found in the second segment, the "catalog" class and the "product_lookup" method are instead used.
@@ -111,10 +111,10 @@ Higher routes will always take precedence over lower ones.A URL containing the word "journals" in the first segment will be remapped to the "blogs" class.
$route['blog/joe'] = "blogs/users/34";
-A URL containing the segments blog/joe will be remapped to the "blogs" class and the "users" method. The ID will be set to "34".
+A URL containing the segments blog/joe will be remapped to the "blogs" class and the "users" method. The ID will be set to "34".
$route['product/(:any)'] = "catalog/product_lookup";
-A URL with "product" as the first segment, and anything in the second will be remapped to the "catalog" class and the "product_lookup" method.
+A URL with "product" as the first segment, and anything in the second will be remapped to the "catalog" class and the "product_lookup" method.
$route['product/(:num)'] = "catalog/product_lookup_by_id/$1";
A URL with "product" as the first segment, and a number in the second will be remapped to the "catalog" class and the "product_lookup_by_id" method passing in the match as a variable to the function.
@@ -123,7 +123,7 @@ Higher routes will always take precedence over lower ones.If you prefer you can use regular expressions to define your routing rules. Any valid regular expression is allowed, as are back-references.
+If you prefer you can use regular expressions to define your routing rules. Any valid regular expression is allowed, as are back-references.
Note: If you use back-references you must use the dollar syntax rather than the double backslash syntax.
@@ -142,7 +142,7 @@ Higher routes will always take precedence over lower ones.$route['default_controller'] = 'welcome';
This route indicates which controller class should be loaded if the URI contains no data, which will be the case -when people load your root URL. In the above example, the "welcome" class would be loaded. You +when people load your root URL. In the above example, the "welcome" class would be loaded. You are encouraged to always have a default route otherwise a 404 page will appear by default.
$route['404_override'] = '';
--
cgit v1.2.3-24-g4f1b