Hi there,
I have a problem with my 404 pages not appearing when expected - but only in one area of my site.
I have strict urls enabled and a custom 404 page setup and specified as site/404 in the template global preferences.
In most areas of my site this is all working just fine and as expected.
Any url that has the first segment of the url set as “farm” : see http://www.eastsidecottages.co.uk/farm/ is not behaving as expected however. Misspelling any segment after segment_1 does not result in a 404 as expected but tries to show the content of the farm template. (Although a little mangled). The same behaviour occurs if I add random segments to the end - the expected behaviour would be to throw a 404.
There is a blog showing single entries at http://www.eastsidecottages.co.uk/farm/farm_blog/ with an example single entry here:
http://www.eastsidecottages.co.uk/farm/farm_blog/planting_new_woodlands/
I have incorporated the following code into the single entry template:
{exp:channel:entries channel="farm_blog" disable="categories|pagination" member_data="yes" limit="1" require_entry="yes"}
{if no_results}
{redirect="404"}
{/if}There is another blog in the site that works perfectly with this code (it has a different url segment_1) but this is not working correctly. I tried replacing the redirect with just some text to see if the conditional is working but it does not work.
The Structure plugin is being used - and I can’t easily disable to test as the site is live and so much relies on it.
My understanding of the way the EE urls work is that if EE encounters a url segment 2 that is not a template and strict urls is enabled it should result in a 404.
Thanks for your help in advance. Michael