I would like to redirect a template based on segments, such that example.com/myTemplateGroup and example.com/myTemplateGroup/myTemplateIndex are valid but example.com/myTemplateGroup/yoYoYo is invalid where myTemplateIndex in myTemplateGroup is the default template for EE.
Example:
{if (segment_1 == "" XOR segment_1 == "myTemplateGroup") AND (segment_2 == "" XOR segment_2 == "myTemplateIndex")}
<!-- great -->
{if:else}
{redirect="404"}
{/if}EE spits out {redirect="404"} instead of actually redirecting.
(The reason for this is that I’m using the .htaccess method to remove index.php where every URI that does not match an actual file is sent to EE. Regardless of my reason, why does the {redirect} not work?)
Much thanks in advance!