Greetings all,
I like to check that URL’s using pagination are valid. For example http://example.com/wines-goods/category/red-wines/P3 should redirect to a 404 page if there is no page 3, but the same URL with “P2” instead of “P3” should be valid if there is a page 2.
I’ve written PHP code that checks for both a valid pattern (“Pxx”) as well as that the page logically exists (for example if you are using ‘limit=”3”’ and you have 4 entries, there should be a valid page 2.
But, I’m wondering if there is a plug-in for this (I couldn’t find one), or some other more elegant way people are validating pagination URL’s. If not, I’d like to turn my code into a plug-in. It might be tricky to make it general purpose, but I think I could do this if I allow people to pass in a regexp. Your thoughts?
Thanks, -NorthK
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.