Heyo.
I’m working on a site in EE 2.1 (latest build), and I’m running into issues with a proper 404 response code.
I’m using Structure for my page hierarchy, if that’s necessary.
Using NSM .htaccess, but I’ve disabled this for the time being.
404 template is set (page_layouts/404) and strict URLs are set to Yes.
If I visit domain.com/about-us (a real page), I get a 200 OK status.
If I visit domain.com/billyjojimbob, I get a 200 OK status.
If I visit domain.com/about-us/billyjojimbob, I get a 404 status.
My template code is like this (at least the top part) of my default page template:
{exp:channel:entries channel="pages" status="open|hidenav|footernav" limit="1" require_entry="yes" disable="categories|member_data|pagination"}
{if no_results}
{redirect="404"}
{/if}
{embed="embeds/page_header" body_class="innerPage" page_title="{if cf_pages_title_alt}{cf_pages_title_alt}{if:else}{title}{/if}" entry_id="{entry_id}"}
{/exp:channel:entries}Any thoughts as to why segment_1 (an invalid segment_1) which is not a template group, returns 200 OK, but an invalid segment_2 then returns a 404?
I’m kinda lost in response codes anyways, but some clarification here would help.
Thanks!