Hi,
I’m trying to get my template to redirect to my 404 page whenever someone appends something like “P10” to my URL by using no_results, but I can’t seem to get it to work somehow.
In my software/security template where I want to display a list of entries, I use this code:
{exp:weblog:entries weblog="software" category="4" orderby="title" sort="asc" paginate="both" limit="10"}
{paginate}....{/paginate}
{title}
{if no_results}
{redirect="404"}
{/if}
{/exp:weblog:entries}When I visit domain.com/software/security/ for example, it will display a list of up to 10 entries, with possible pagination. This works fine. However, when there’s only 1 entry in the selected category, it shouldn’t be possible to append “P10” (or anything else) to the URL, simply because there’s only 1 entry to be displayed.
Somehow, the no_results conditional is never called. I have tried many things, embedding the weblog entries tag etc, to no avail.
Any ideas on what’s going wrong here?
Many thanks in advance!
Leon