1. Go to this page and download the library: Download grithin/phproute library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
# reposition id
['/item/([0-9]+)/view', '/item/view/[1]', 'regex']
# match anything and name it "path"
['(?<path>.*)', 'prefix/[path]', 'regex']
# match numbers and name it "id"
['old/(?<id>[0-9]+)', 'new/[id]','regex']
return [
['^$','index','regex,last'], # the root path, special in that the initial `/` is removed and the path is empty
['^(?<path>.*)/$','[path]/index','regex,last'], # paths ending in `/` to be pointed to their corresponding index control files
]