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.

Unused templates and blank pages

March 19, 2012 4:38pm

Subscribe [2]
  • #1 / Mar 19, 2012 4:38pm

    nroptions

    46 posts

    I have some Template Groups that have an unused index.  For such Groups, URLs of the form “…/template-group” or “…/template-group/xxxx” will bring one to a blank page rather than generate a 404.

    I would obviously like to avoid sending a visitor to a blank page.  Is there a way to deal with this via EE configuration, and if not, any suggestions on commonly used methods?

    Thanks.

  • #2 / Mar 19, 2012 5:26pm

    the3mus1can

    426 posts

    Put {redirect="404"} into the index template.

  • #3 / Mar 19, 2012 5:46pm

    nroptions

    46 posts

    Tried that, and I now see it in the User Guide.  However, when I try it, the page (via browser) simply displays that as literal text:  {redirect=“404”}

    It is the only data/text in the Template.  I must need to do something else.  The Template is defined as Type=Web Page.

  • #4 / Mar 19, 2012 9:43pm

    nroptions

    46 posts

    Very odd.  I had cut and pasted your text into the template and it failed.  I just cut and pasted it out of the User Guide and it worked.  No idea.

    Anyway, thanks for the info—it was exactly what I needed.

  • #5 / Mar 19, 2012 10:33pm

    Bhashkar Yadav

    727 posts

    is there any template group/template named “404”?

    redirect allows redirect to another template.

    So if you have created the template group named “404”, please try with {redirect="404/index"} i.e give full template path including group name.

  • #6 / Mar 19, 2012 11:59pm

    the3mus1can

    426 posts

    The reason the one you pasted from here probably didn’t work was because of the fancy quotes around 404.  I should have put it in a code block and they would not been converted when I posted.

    You do not need to have a 404 template group setup.  When you {redirect="404"} it redirects to whatever is set in Template Manager > Global Template Preferences > 404 page.

  • #7 / Mar 20, 2012 12:09am

    nroptions

    46 posts

    Fancy quotes will get you!  I was beginning to wonder if my eyes had deceived me.

    Yes, I realize that about the 404.  In fact, I had already set the system preference and knew it was working under other conditions.

    Again, thanks.

  • #8 / Mar 20, 2012 6:14am

    Bhashkar Yadav

    727 posts

    the3mus1can, thanks a lot. my way wasn’t correct.

    again many thanks ...

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

ExpressionEngine News!

#eecms, #events, #releases