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

EE3 - hidden templates showing Template Groups Index not 404

How Do I?

Neil Evans's avatar
Neil Evans
1,374 posts
about 9 years ago
Neil Evans's avatar Neil Evans

I have strict URL’s on, and a 404 page specified.

I have hidden a template with underscore as per documentation. When accessing this template via the front end of the website: http://domain.net/index.php/layouts/_hidden

I am shown the index template for that group (200 OK status code). Rather than a 404 page and code.

Is this correct, as it is not really what i would expect or like! How can i change this behaviour?

Second part - is the hidden template still appears in “pages” field drop down list. It would be nice if this (or another method) thinned out the drop down so its not crazy scary for the user to select from.

Third part - can i hide a group? Fourth - can i remove the index from a group?

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
about 9 years ago
Ingmar Greil's avatar Ingmar Greil
How can i change this behaviour?

Try this (untested):

{if segment_2 ^= "_"}{redirect="404"}{/if}
Third part - can i hide a group?

Not easily. You can leave out the default group, and you could probably use mod_rewrite, but I think Template Routes would be far superior a solution.

Fourth - can i remove the index from a group?

No, but you can simply stick

{redirect="404"}

in there and just never use it.

       
Neil Evans's avatar
Neil Evans
1,374 posts
about 9 years ago
Neil Evans's avatar Neil Evans

Hi Ingmar, Thanks for the response. The consensus is then that the script does not see a private file and redirect to 404 as error. It randomly does somehting else. bit odd, but yes we can work around it - not sure we should have to though!

N

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
about 9 years ago
Ingmar Greil's avatar Ingmar Greil

By all means, go ahead and file a bug report. This was just meant as a quick band-aid solution.

       

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.