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.

Default template group page on non-existing URL

October 03, 2011 7:52am

Subscribe [4]
  • #1 / Oct 03, 2011 7:52am

    tomazbojc

    32 posts

    Is it possible to have index file in template group as a default landing page when certain URL does not exist?

    Example:
    If user is landing on domain.org/br/qr01 or domain.org/br/01 I’d like to redirect him in both cases to domain.org/br/.

    Now URL domain.org/br/qr01 is fine but domain.org/br/01 brakes up the page because the second segment is triggering something in EE (categories?) and that results in page without content.

    Any ideas?

  • #2 / Oct 03, 2011 10:45am

    Boyink!

    5011 posts

    Do you have strict urls enabled?

    If so the index template should get called when EE can’t find a template with the second segment in the URL. 

    From there EE looks for a url_title to match.

    Usually you can handle any issues with some conditionals in the template groups’ index template.

  • #3 / Oct 03, 2011 12:01pm

    Barrel

    92 posts

    I also recommend the template conditionals—one of my co-workers forwarded me this link that was helpful: http://www.capelinks.com/blog/404-error-control-expression-engine/

  • #4 / Oct 03, 2011 5:12pm

    Dan Decker

    7338 posts

    tomazbojc,

    Did Michael and barrel’s suggestions get you on the right path? Is there anything else we can assist you with?

    Cheers,

  • #5 / Oct 04, 2011 3:48am

    tomazbojc

    32 posts

    Hi guys, thanks for your replies, I relay appreciate it. What I used was

    {if no_results}{redirect="{country_code}/index"}{/if}

    and it works as I want it to. Thanks again 😊

  • #6 / Oct 05, 2011 3:19pm

    Dan Decker

    7338 posts

    tomazbojc,

    Thanks for sharing your solution! I’m happy to see you are all set. If you need assistance in the future, let us know by starting a new thread.

    Cheers!

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

ExpressionEngine News!

#eecms, #events, #releases