December 03, 2010

Categories:

Expression engine, ee, 404, redirect, channels

Expression Engine 404 Redirect No Results

Expression engine only redirects to a 404 if the first segment ({segment_1}) of the url is incorrect. This means, if you enter the wrong url whilst in a template folder, the page will simply render blank or some other generic result, perhaps the first record in your channel, by default.

This can be fixed with a simple loop in the template, to check for {no_results}:

{if no_results}
{redirect="404"}
{/if}

Comments

There are no comments right now. Be the first to leave one...

Please leave your comment...

11
likes

0
comments