I am upgrading a CakePHP 1.x project to CakePHP 3.x
The 1.x project has URLs that are published in places that we can not change, like books, so I need to rewrite the previous URLs to match the Pagination URLs in CakePHP 3.x
This is an example of the 1.x URLs
http://example.org/ledgers/index/1/2
http://example.org/ledgers/index/<page_int>/<tribe_id_int>
This is what the 3.x URLs look like
http://example.org/ledgers/index?page=1&tribe=2
I have tried this htaccess ruleset
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteRule ^ledgers/index/(\d)+/(\d)+$ /ledgers/index?page=$1&tribe=$2 [NC]
</IfModule>
And the output from
die(print_r($this->request->getQueryParams(), true));
is
Array()
I saw in another StackOverflow post to try and use
https://www.generateit.net/mod-rewrite/index.php
Which gave me
RewriteRule ^ledgers/index/([^/]*)/([^/]*)$ /ledgers/index?page=$1&tribe=$2 [L]
but still the output from
die(print_r($this->request->getQueryParams(), true));
is
Array()
Any ideas on how I can get this to work?