EllisLab text mark
Advanced Search
     
Show the index of a template group if the URL that I am pointing to doesn’t exist.
Posted: 10 August 2012 08:05 PM   [ Ignore ]
Joined: 2010-12-22
15 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 t,he 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.

 
Posted: 13 August 2012 12:37 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2005-10-18
7340 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

http://encuentrocliente.isa.com.co/index.php/confirmar/?c=0123 

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

Cheers,

 

 Signature 

How may I help you?

 
Posted: 13 August 2012 01:25 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2010-12-22
15 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.

 
Posted: 14 August 2012 02:09 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2005-10-18
7340 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}</p>
{/exp:channel:entries}
 
</body>
</
html

Display just fine with this URL:

http://engine.dev/confirm/?c=0123 

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,

 Signature 

How may I help you?