summaryrefslogtreecommitdiffstats
path: root/user_guide/general/routing.html
diff options
context:
space:
mode:
authorGreg Aker <greg.aker@ellislab.com>2011-04-27 08:47:47 +0200
committerGreg Aker <greg.aker@ellislab.com>2011-04-27 08:47:47 +0200
commita6507905578f1cf209776ae3d53099a005a06823 (patch)
tree9f23bb557f920034cf65c86059c84e37efd34d79 /user_guide/general/routing.html
parent60ef4ea72e169e174ff8dbb421609a178a3c0c48 (diff)
parent25d495b4a2598f771a858108a2cd2e96f0130412 (diff)
merging in changes
Diffstat (limited to 'user_guide/general/routing.html')
-rw-r--r--user_guide/general/routing.html17
1 files changed, 11 insertions, 6 deletions
diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html
index 6ee6ad384..6f06ad64f 100644
--- a/user_guide/general/routing.html
+++ b/user_guide/general/routing.html
@@ -80,7 +80,7 @@ To overcome this, CodeIgniter allows you to remap the URI handler.</p>
<h2>Setting your own routing rules</h2>
-<p>Routing rules are defined in your <var>application/config/routes.php</var> file. In it you'll see an array called <dfn>$route</dfn> that
+<p>Routing rules are defined in your <var>application/config/routes.php</var> file. In it you'll see an array called <dfn>$route</dfn> that
permits you to specify your own routing criteria. Routes can either be specified using <dfn>wildcards</dfn> or <dfn>Regular Expressions</dfn></p>
@@ -90,7 +90,7 @@ permits you to specify your own routing criteria. Routes can either be specified
<code>$route['product/:num'] = "catalog/product_lookup";</code>
-<p>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.
+<p>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.</p>
@@ -111,10 +111,10 @@ Higher routes will always take precedence over lower ones.</p>
<p>A URL containing the word "journals" in the first segment will be remapped to the "blogs" class.</p>
<code>$route['blog/joe'] = "blogs/users/34";</code>
-<p>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".</p>
+<p>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".</p>
<code>$route['product/(:any)'] = "catalog/product_lookup";</code>
-<p>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.</p>
+<p>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.</p>
<code>$route['product/(:num)'] = "catalog/product_lookup_by_id/$1";</code>
<p>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.</p>
@@ -123,7 +123,7 @@ Higher routes will always take precedence over lower ones.</p>
<h2>Regular Expressions</h2>
-<p>If you prefer you can use regular expressions to define your routing rules. Any valid regular expression is allowed, as are back-references.</p>
+<p>If you prefer you can use regular expressions to define your routing rules. Any valid regular expression is allowed, as are back-references.</p>
<p class="important"><strong>Note:</strong>&nbsp; If you use back-references you must use the dollar syntax rather than the double backslash syntax.</p>
@@ -142,9 +142,14 @@ Higher routes will always take precedence over lower ones.</p>
<code>$route['default_controller'] = 'welcome';</code>
<p>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.</p>
+<code>$route['404_override'] = '';</code>
+
+<p>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 <samp>show_404()</samp> function, which will continue loading the default <dfn>error_404.php</dfn> file at <var>application/errors/error_404.php</var>.</p>
+
<p class="important"><strong>Important:</strong>&nbsp; The reserved routes must come before any wildcard or regular expression routes.</p>
</div>