I have a template that I want to use as a parent template (personal-finance/index template with no segment_2 in URL and fixed entry_id=“11”) and I also want to use it if there is an value in URL (segment_2). I need to prevent the use of segment_3 as it should not ever be used by the client as I am building a 2 level navigation menu. Is this correct way to code the conditionals? It seems to work, but looking for advise if this is a preferred method.
{if segment_3 != ""}{redirect="404"}{/if}
{if segment_1 == "personal-finance" && segment_2 == ""}
{exp:channel:entries channel="pages" entry_id="11" disable="categories|member_data|pagination" limit="1" dynamic="no"}
{if no_results}{redirect="404"}{/if}
{simple_content_body}
{/exp:channel:entries}
{/if}
{if segment_1 == "personal-finance" && segment_2 != ""}
{exp:channel:entries channel="pages" disable="categories|member_data|pagination" require_entry="yes" limit="1"}
{if no_results}{redirect="404"}{/if}
{simple_content_body}
{/exp:channel:entries}
{/if}