We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Plug-in for valid URL checking and redirection to 404 page for pagination

Development and Programming

northk's avatar
northk
51 posts
14 years ago
northk's avatar northk

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

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.