PHP code example of linkeddatacenter / url-rewriter
1. Go to this page and download the library: Download linkeddatacenter/url-rewriter 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/ */
linkeddatacenter / url-rewriter example snippets
$dispatcher = new Dispatcher([
new Middlewares\BasePath([
[
'/(\w+)' => '/$1/pluto',
'/(\w+)/(\w+)/(\w+).(csv|json|xml)(.*)' =>'/$1/docstore?db=$2&table=$3&format=$4$5',
])
]);
$response = $dispatcher->dispatch(new ServerRequest());