I'm using the following (https://github.com/rsanchez/resource_router):
$config['resource_router'] = [
'news-and-resources' => 'www/news-and-resources',
'usa/news-and-resources' => 'www/news-and-resources',
'cn/news-and-resources' => 'www/news-and-resources',
'zh/news-and-resources' => 'www/news-and-resources',
'usa/news-and-resources/:pagination' => 'www/news-and-resources',
];
The last array item should match a url of -
http://www.example.com/usa/news-and-resources/P3
But it just throws a 404 error, even though I know it should load more entries.
What's causing this problem? I'm using Expression Engine 3.4.1
Update:
Using the Resource Router plugin (purely because I can’t get this working inside EE’s routing system) I’ve done this:
$config['resource_router'] = array(
'news-and-resources/:pagination' => 'www/news-and-resources',
'(usa|cn|zh)/news-and-resources/:pagination' => 'www/news-and-resources',
'news-and-resources/(news|resource)/:pagination' => 'www/news-and-resources',
'(usa|cn|zh)/news-and-resources/(news|resource)/:pagination' => 'www/news-and-resources',
);
So, based on the routes above, the following page requests work and load correct content:
http://www.example.co.uk/news-and-resources
http://www.example.co.uk/news-and-resources/P3
http://www.example.co.uk/news-and-resources/news
http://www.example.co.uk/news-and-resources/resource
http://www.example.co.uk/news-and-resources/news/P3
http://www.example.co.uk/news-and-resources/resource/P3
http://www.example.co.uk/usa/news-and-resources
http://www.example.co.uk/usa/news-and-resources/news
http://www.example.co.uk/usa/news-and-resources/resource
http://www.example.co.uk/usa/news-and-resources/news/P3
http://www.example.co.uk/usa/news-and-resources/resource/P3
You’ll notice the only difference is that there is no
http://www.example.co.uk/usa/news-and-resources/P3
And that’s because it’s the only one that doesn’t work, despite there being a route defined
'(usa|cn|zh)/news-and-resources/:pagination' => 'www/news-and-resources
(usa|cn|zn)
.