User Tools

Site Tools


how_to_create_a_custom_route_url

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
how_to_create_a_custom_route_url [2016/04/17 00:43]
admin
how_to_create_a_custom_route_url [2020/09/30 23:53] (current)
tim old revision restored (2020/08/27 11:30)
Line 17: Line 17:
       return array(       return array(
         array(         array(
-          'pattern' => '#^my-fantastic-url$#',  // This is the regex pattern so the platfrom knows how to resolve a rewritten url back to a document+          'pattern' => '#^my-fantastic-url-(\d+)$#',  // This is the regex pattern for resolving a rewritten url back to a resource
           'page' => 'mypage',  // This is the target document meaning pages/mypage.inc.php           'page' => 'mypage',  // This is the target document meaning pages/mypage.inc.php
-          'params' => '', // Create URL query parameters from the result of the regex $1 $2 etc.+          'params' => '', // Establish URL query parameters based on the result of the regex. E.g. page_id=$1 etc.
           'redirect' => true, // If accessing a non rewritten url, let's do a 301 redirect           'redirect' => true, // If accessing a non rewritten url, let's do a 301 redirect
         ),         ),
how_to_create_a_custom_route_url.1460846594.txt.gz ยท Last modified: 2016/04/17 00:43 by admin