I want to create pagination on my Category pages. I have added this too the footer and configured it via the config and it shows up as expected.
Looks great at first sight, however when I select a different page, for example the 4th page. I get redirected to a link like. https://www.example.com/en/mycategory/where/p/4/
This page gives a 404 error. https://www.example.com/en/category4?p=4
Works fine, I can't seem to be able to change the URL structure anywhere. The first idea which comes to mind is to use htaccess rewrites. But this will get nasty very soon if I am also going to add filters.
Which generate links such as https://www.example.com/en/mycategory/where/dir/asc/order/price/
And changing the amount of products per page generate a link like https://www.example.com/en/mycategory/where/limit/30/ Which all give 404 errors.
This will become a mess to do via htaccess if I ever want to make these combinable.
What place should I look to figure out the URL structure, or where should I activate to accept this url structure? (I prefer to be able to change it because this looks like bad SEO)
Since categories can have subcategories, a link can also have more subdivision before the "/where/" making htaccess even worse. URL: https://example.com/en/mycategory/mysubcategory/where/p/5
Edit: I tried the following htaccess code, which is supposed to be recursive, but I get 500 internal server errrors.
Turn the slashed URL into query strings
RewriteRule ^(.*)/where/([^/]*)/([^/]*)(/.*)?$ $1/where/$4?$2=$3 [L,QSA,R=301]
Remove the "/where/" from the url
RewriteRule ^(.*)/where/?$ $1 [L,QSA,R=301]
(I'd prefer a 301 redirect because of SEO reasons, don't want my pagerank splitting up.)