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

Template Route Manager, 'Segments Required'- if segments aren't present, then show 404

How Do I?

Inigo Pascall's avatar
Inigo Pascall
4 posts
10 years ago
Inigo Pascall's avatar Inigo Pascall

I have set up a new template group which is going to provide templates for an ajax call made with the jQuery plugin ‘Magnific Popup’.

The URL structure will look like:

/ajax/{name}/{id}

I have set the ‘segments required’ option to ‘yes’ in the Template Route Manager. It seems to be working, but when any of the segments are missing, it just shows a blank page, rather than a 404. Why? Can I set this somewhere to show a 404?

Bonus points: limit this route to only ajax requests, and show a 404 for any normal get requests. (can’t see any easy way of doing this either- is there a plugin perhaps?)

Thanks.

       

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.