0

I have a template group called 'members' with two templates - 'male' and 'female'.

Now, I want the 'index'-template of the 'members'-group to redirect to the 'male'-template, whenever somebody types in the following URL:

my_site.com/members

I've setup a route in the CP like this...

'members/index' => 'members/male'

... and put this in my 'members/index'-template:

{route="members/male"}

I expected this to initiate a redirect, but it doesn't. So, how do the new native template routes actually work?

0

OK, I've just discovered the following feature in the access-section of the template manager:

"When unauthorized users try to access this page, show this one instead"

This solves my problem perfectly!

Or, as an alternative, I can add this to the members/index template:

{if segment_2 != ""}
    {redirect="members/male"}
{/if}
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.