Most people don't want to get a 404 page, however, I am having issues with a site where 404 pages don't show when you enter an erroneous URL.
Example: http://livefreehomehealthcare.com/products/asdasdasdasd/ does not exist, but instead of a 404 page, which has been created and works (see example), I get the products page or segment_1 of the URL.
It appears that if segment_1 is a valid part of the URL then the strict URL rule that should redirect to the 404 page doesn't fire properly.
I am running EE 2.5.2
Update: MediaGirl suggested below that I use the require_entry="yes" parameter in the channel tags. I did this and it works too well.
Here's what I mean. I am using the index template of the template group for the "home" page for the section so that "our products" shows up as /products/ instead of /products/our-products. Here is the code:
{exp:channel:entries channel="products" entry_id="12"}
<h2>{title}</h2>
{body}
{/exp:channel:entries}
This displays the content fine, but is also open to 404 failure. So I tried this:
{exp:channel:entries channel="products" entry_id="12" require_entry="yes"}
{if no_results}{redirect="404"}{/if}
<h2>{title}</h2>
{body}
{/exp:channel:entries}
When I do it this way 404 works too well and I can't see the contents of the /product/ page.
Is there a happy medium here?
Any ideas for getting this to work correctly would be appreciated.
Thanks.