I have a site which got a temporary page indexed by google, and then the page was removed, but going to the URL gives content from the previous URL segment, and I am trying to figure out how to get this URL to generate a 404 instead.
In more detail:
I had a page at http://mydomain.com/my-template-group/my-template (not the real names)
This content was removed from the site. There is no longer a template in my-template-group named my-template, but when the url http://mydomain.com/my-template-group/my-template is visited, instead of showing a 404 for content and templates that are no longer there, the site instead shows the content for http://mydomain.com/my-template-group
In fact, while investigating this, I realized that visiting http://mydomain.com/my-template-group/anything-at-all does not generate a 404 as it should, and instead displays the content for my-template-group instead.
Is this default behavior? And how can I fix it so visiting any page that is not specifically a template generates a 404?
Thanks tons.
I’ll answer part of my own question for posterity. Sigh. It is default behaviour.
https://ellislab.com/expressionengine/user-guide/urls/404pages.html
However, after reviewing this, I still don’t see a way to solve the problem.
{if no_results}
{redirect="404"}
{/if}is no use because there are results in my-template-group, and surely I wouldn’t have to do something like:
{if segment_3 != 'my-template' && segment_3 != 'my-template-2' && ... }
{redirect="404"}
{/if}and explicitly list out every template in the template group that should NOT give a 404? Or would I?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.