ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to 404 redirect a category template?

January 02, 2010 8:00am

Subscribe [2]
  • #1 / Jan 02, 2010 8:00am

    Andy Williamson

    16 posts

    Can anyone help with a 404 problem I’m having with my category template please?

    I’m doing some SEO housekeeping and have successfully set up 404 redirects for my weblog index template and the article templates as follows:-

    index template uses

    {if segment_2 != ''}
      {redirect="404"}
    {/if}

    article template

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


    Category template hasn’t worked out. I want to include a 404 redirect if someone links to or enters an incorrect category ID

    Currently for example:

    my URL path for categories is “www.mydomain.com/index.php/weblog/cat/C44/” if someone links or enters a category number that doesn’t actually exist I want to do a 404 redirect, currently I’m just getting a broken template displaying.

    Any advice appreciated

    thanks Andy

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases