www.cooking/recipes/apple_pie
The first Expression Engine segment (recipes) represent the recipes channel, and the second segment represent an entry (here apple_pie)
If an entry doesn't exist or is misspelled, i use this code to redirect to the 404 page, and it works fine:
{exp:channel:entries channel="recipes" limit="1" require_entry="yes"}
{exp:ifelse parse="inward"}
{if no_results}
{redirect="error/404"}
{/if}
{/exp:ifelse}
{/exp:channel:entries}
But if I add a segment (dessert), always have redirect to the 404 page, even if the entry exist. Without the redirect code the entries pages like (www.cooking/recipes/dessert/apple_pie) works fine, but i lose the redirect function.
www.cooking/recipes/dessert/apple_pie
What am I doing wrong here?