summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/general/urls.rst
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide_src/source/general/urls.rst')
-rw-r--r--user_guide_src/source/general/urls.rst41
1 files changed, 31 insertions, 10 deletions
diff --git a/user_guide_src/source/general/urls.rst b/user_guide_src/source/general/urls.rst
index 6b390b559..d678e4a0a 100644
--- a/user_guide_src/source/general/urls.rst
+++ b/user_guide_src/source/general/urls.rst
@@ -20,7 +20,6 @@ approach, usually represent::
example.com/class/function/ID
-
#. The first segment represents the controller **class** that should be
invoked.
#. The second segment represents the class **function**, or method, that
@@ -28,9 +27,28 @@ approach, usually represent::
#. The third, and any additional segments, represent the ID and any
variables that will be passed to the controller.
-The :doc:`URI Class <../libraries/uri>` and the :doc:`URL Helper <../helpers/url_helper>` contain functions that make it
-easy to work with your URI data. In addition, your URLs can be remapped
-using the :doc:`URI Routing <routing>` feature for more flexibility.
+The :doc:`URI Library <../libraries/uri>` and the :doc:`URL Helper
+<../helpers/url_helper>` contain functions that make it easy to work
+with your URI data. In addition, your URLs can be remapped using the
+:doc:`URI Routing <routing>` feature for more flexibility.
+
+Friendly URLs
+=============
+
+As you might guess, since there's a straight relationship between
+URI segments and the controller/method pair that's being called,
+those two determining segments must represent a valid class and
+method name.
+You may however also use dashes in the class/method-representing
+segments, and they will automatically be translated to underscores
+in order to be valid routed segments.
+
+For example::
+
+ example.com/my-settings/change-password/
+
+The above example will route to the ``My_settings`` controller and
+its method ``change_password()``.
Removing the index.php file
===========================
@@ -39,7 +57,7 @@ By default, the **index.php** file will be included in your URLs::
example.com/index.php/news/article/my_article
-If your Apache server has mod_rewrite enabled, you can easily remove this
+If your Apache server has *mod_rewrite* enabled, you can easily remove this
file by using a .htaccess file with some simple rules. Here is an example
of such a file, using the "negative" method in which everything is redirected
except the specified items:
@@ -54,7 +72,10 @@ except the specified items:
In the above example, any HTTP request other than those for existing
directories and existing files is treated as a request for your index.php file.
-.. note:: Note: These specific rules might not work for all server configurations.
+.. note:: These specific rules might not work for all server configurations.
+
+.. note:: Make sure to also exclude from the above rule any assets that you
+ might need to be accessible from the outside world.
Adding a URL Suffix
===================
@@ -91,7 +112,7 @@ active. Your controllers and functions will then be accessible using the
index.php?c=controller&m=method
-.. note:: If you are using query strings you will have to build
- your own URLs, rather than utilizing the URL helpers (and other helpers
- that generate URLs, like some of the form helpers) as these are designed
- to work with segment based URLs.
+.. note:: If you are using query strings you will have to build your own
+ URLs, rather than utilizing the URL helpers (and other helpers
+ that generate URLs, like some of the form helpers) as these are
+ designed to work with segment based URLs. \ No newline at end of file