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.

Show the index of a template group if the URL that I am pointing to doesn't exist.

August 10, 2012 8:05pm

Subscribe [1]
  • #1 / Aug 10, 2012 8:05pm

    jecampos

    10 posts

    Hello

    I am trying to make and external application to redirect to an URL like this http://encuentrocliente.isa.com.co/index.php/confirmar/, but the original URL contains a Unique ID, something like this ?c=XXXXXX

    So, when this external application is trying to redirect to this URL, this maintains the Unique ID on the URL, something like this http://encuentrocliente.isa.com.co/index.php/confirmar/?c=0123.

    I need that Expression Engine ignores the Unique ID at the end of the URL, an goes to the index of the template group “confirmar”

    Note: I don’t want to make the index of the template group “confirmar” my site home page.

    Thanks in advance

    Jhon E.

  • #2 / Aug 13, 2012 12:37pm

    Dan Decker

    7338 posts

    Hi Jhon,

    Thanks for posting your question to the forums!

    What have you tried so far and what has been the result?

    ExpressionEngine will call the template group “confirmar”, as long as it exists. Then it will look for a template named “?c=XXXXXX”. When it doesn’t find one, it will default to the “index” template of the group and try to supply the value as a url_title. Which it likely won’t find and that will result in a 404 or a redirect to your homepage.

    What do you want to happen when the user is redirected to

    <a href="http://encuentrocliente.isa.com.co/index.php/confirmar/?c=0123">http://encuentrocliente.isa.com.co/index.php/confirmar/?c=0123</a>

    Knowing what you want to happen, we should be able to come up with a workable solution!

    Cheers,

     

  • #3 / Aug 13, 2012 1:25pm

    jecampos

    10 posts

    Hello Dan,

    Thanks for your reply.

    What I want to happen is when the user goes to the URL http://encuentrocliente.isa.com.co/index.php/confirmar/?c=0123 (with the variable “0123”) it should be redirect to the index of the template group “confirmar” (http://encuentrocliente.isa.com.co/index.php/confirmar/index.php), not to the default index website.

    By the moment we have changed the setting for 404 page to confirmar/index.php, I know this is not the best practice.

    I hope you can help me advising a better solution

    Thanks in advance

    Jhon E.

  • #4 / Aug 14, 2012 2:09pm

    Dan Decker

    7338 posts

    Hi Jhon,

    In my testing, I was able to have this template:

    <!DOCTYPE html>
    <html lang="en">
     <head>
      <title>New Page</title>
     </head>
     <body>
      Just Hangin out!
     {exp:channel:entries
      channel='sandbox'
      status='not closed'
      orderby='title'
      dynamic="no"
      entry_id="53"
      orderby="date" sort="desc"}
    
    <h2>{title}</h2>
    <p>{excerpt}<br />
    {/exp:channel:entries}<br />
     </body><br />
    </html>

    Display just fine with this URL:

    <a href="http://engine.dev/confirm/?c=0123">http://engine.dev/confirm/?c=0123</a>

    That template is the index template of the “confirm” group and it worked just fine.

    Is that not what you are seeing?

    Can you share the code for your confirmar/index template and tell me your settings in Design->Templates->Global Preferences?

    Are you using .htaccess to direct 404s on your server?

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases