I am trying to achieve the following setup, using just one template, and I hope someone can help point me to the best solution. Here it goes…
> If a user navigates to http://www.domain.com/news the ‘news’ template displays excerpts from the latest 5 channel entries, with additional entries being paginated.
> If a user navigates to http://www.domain.com/news/article_url_title the ‘news’ template displays one full channel entry based on the url_title passed in {segment_2}.
> If no results are returned based on {segment_2} the page redirects to a custom 404.
—I have done all the above, it’s this next bit I can’t figure out—
> If a user is looking at the paginated content at http://www.domain.com/news/P5 my existing code directs them to the 404 as I have no channel entries with ‘P5’ as the URL title.
So essentially, how do I go about saying:
If segment_2 && no results, redirect to 404, unless it's a paginated page?I hope this makes sense and someone is able to help.
Many thanks in advance,
Chris