Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

too many redirects

too many redirects

Hello,
I have set up a rule which seems to be working correctly to redirect UK ip address to a UK version of our website. The only issues I get now is an error saying 'too many redirects'.
I assume this is to do with the rule repeatedly sending the request to redirect. How do I make the rule only redirect once and then stop?
Thanks Karen

kazzac
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: too many redirects

Hi Karen,

you've correctly diagnosed the issue smile
There are several ways you could address this.

1 - set up the rule so that only pages that are NOT in the UK version of the web site can make the redirect rule succeed. One way to do this would be to use the Menu selectors to ensure the rule only applies on certain non-UK pages, OR perhaps on "all menu items except the specific UK ones".

2 - in some cases, it may be appropriate to only redirect users once (per session, or maybe forever). After that, if they want to return to the page they landed on originally, you might want to let them do that.
To set this up, when you do the redirect for the first time, you ALSO set a cookie or session variable. You can do this in the Succeed Action (set session cookie A, or set session variable A, etc).
Then make a new rule and place this rule just BEFORE the one that does the redirect.
In this new rule, detect the session variable or cookie (depending on which one you decided to use), which is found in the Quick Rules tab. Then in the Succeed Action for this rule "Stop Processing".

In this way, if they have already been redirected once, then the next time they go to a page, Chameleon doesn't get to the rule that does the redirect, so it won't do it again until the session expires or cookie is removed. (or on a new browser).

Hope that makes sense
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: too many redirects

Thanks for this it has helped me alot.
The only thing I am not sure is working are the cookies you were talking about. The redirect doesn't seem to work when I implement them so I have just disabled them and only used the IP redirection.

Thanks

kazzac
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10734
Newest User:
gudad2
Members Online:
2
Guests Online:
214

Online: 
marvin8787, gudad2

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked