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.

 

Chameleon URL Detect

Chameleon URL Detect

This should have taken about 5 minutes or less but I'm blowed if I can get the rule to trigger. The rule is published.
I'm running Joomla 3.3.6 and downloaded Chameleon last night so it the latest version. I know Chameleon is functioning because the demo rule to change the template for non logged in users triggers.
I have two domains, a main domain for testing called gurubak.slu.biz and a slave site set up with framed forward called corinth.elearning.ga forwarding to the main site. I have looked at: - http://www.metamodpro.com/forums/topic?id=2173 and, as far as I can see I am set up (fundamentally) the same. I will eventually change the home page to a different article for the slave site but wanted to ensure the template changed first of all. Seemed logical. One small step at a time.
My Rule: -
Details - rule name - published
Config - Nothing changed.
Quick rules - Nothing changed
Environment -
Domain Name(s) = corinth.elearning.ga
Page URL - "contains" corinth.elearning.ga (I've tried "ends in" and verious others to no avail. I've tried referrer with no luck.)
Referrer = ignore
All others fields are blank
Menu Handling, Contents and components,User Groups and PHP remain as they were when the rule was created.
Actions - Succeed template = "corinth02" , Next action set to stop. everything else is as it was set from new. There are no fail actions except continue.

That's it. It should have been simple and intuitive for somebody with my years of experience in designing database systems from scratch (50 year) But there must be something I have missed. I am reasonably happy that the referrer in the HTTP header is OK but, at the moment, that's all I have left to consider. I've studied the manual together with the forum and there must be something I have missed.

Thanks in advance for helping this poor wizzened old man who is getting more grey each hour.

Ian C

Thanks,

Ian C

ianc
Doctor or so they tell me
Beginner Modder
ranks
useravatar
Offline
18 Posts
User info in posts
Administrator has disabled public posting

Re: Chameleon URL Detect

Hi Ian,

I think I know what the issue is. You say that you are using "frame forwarding" on corinth.elearning.ga, and inside the frame it is displaying the site http://gurubak.slu.biz/.

When you do this, the site http://gurubak.slu.biz/ is accessed inside of an HTML frame:

<HTML>
<HEAD>
<TITLE>corinth.elearning.ga</TITLE>
</HEAD>
<FRAMESET>
<FRAME SRC="http://gurubak.slu.biz/" NORESIZE>
<NOFRAMES>
Your browser does not support frames.
</NOFRAMES>
</FRAMESET>
</HTML>

Your browser then makes an HTTP request to the frame src provided: http://gurubak.slu.biz/

This HTTP request is basically identical to the request made if you went directly to http://gurubak.slu.biz/ in your browser.
The effect of this however is that the server (http://gurubak.slu.biz/) has no idea that the BROWSER appears to be viewing a site called corinth.elearning.ga. That info doesn't get transferred in the HTTP request.

Therefore Chameleon has no way to determine that there's any difference between someone viewing the page by going through a frame on corinth.elearning.ga, or direct to gurubak.slu.biz.

That's why it's not working.

One way to make Chameleon be able to recognise when the site is being viewed on one domain vs another domain, is to set up what in cPanel is called 'parked domains'. This is when 2 domain names are pointed to the same IP address, and the web server is set up to provide the same content (Joomla installation) to both domains. In that case, the web server (and Chameleon) can pick up the HTTP header mentioning the domain name, and make decisions based on this.

Trust 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
3319 Posts
User info in posts
Administrator has disabled public posting

Re: Chameleon URL Detect

Unfortunately, if I set it up as a standard 301 or 302 forward the rule still does not trigger. As we are also web space providing ISPs I can do that. Or is there something else wrong with the forwarding that I am no aware of? I did try it with a parked domain and the rule still didn't trigger. We run Plesk.

I know this is a simple problem, it's just identifying the issue.

Never too old to learn. Still learning.

Please!

Thanks.

Ian C

Thanks,

Ian C

ianc
Doctor or so they tell me
Beginner Modder
ranks
useravatar
Offline
18 Posts
User info in posts
Administrator has disabled public posting

Re: Chameleon URL Detect

Heay!

On gurubak I have a parked domain called guru.inslu.ga. It's set up as  a 301 forward. Are you suggesting that the forwarding should be disabled? I also have the same rule set for that domain and that doesn't trigger either. I've just turned the redirect off on that but it may take a time to propagate. Not sure where that will go now as it has no sense of direction. Still Learning but that's how we set up mightysites domains. They work OK like that. Maybe I'm just trying to be too "smart".

The reason this is on the forum rather than being private is that, sooner or later, somebody else could hit the same hosting configuration issues.

Don't know if you've seen this - doubtful as it's still a "dev" site but thought this might help you a little when we go "live" properly.

http://gurubak.slu.biz/index.php/our-re … 90:metamod

Thanks for this help

Best wishes,

Ian C

Thanks,

Ian C

ianc
Doctor or so they tell me
Beginner Modder
ranks
useravatar
Offline
18 Posts
User info in posts
Administrator has disabled public posting

Re: Chameleon URL Detect

Heay! again.

Not sure if turning off the redirect worked or if it hasn't propagated yet.! Time will tell.

How do you want us to help you on our site? I know you can get my email from the forum backend. contact me and we will try and help.

Thanks,

Ian C

ianc
Doctor or so they tell me
Beginner Modder
ranks
useravatar
Offline
18 Posts
User info in posts
Administrator has disabled public posting

Re: Chameleon URL Detect

Hello again,

So I'm still having no luck getting this to change a template. Anyway I try so, I've set up a link on www.hoststlucia.com (right hand side of home page) called "The Learning Guru" a simple joomla menu item to an external URL (http://www.gurubak.slu.biz/). It cannot get much simpler than that.
The new rule is
Environment - Domain Name(s) = hoststlucia.com,www.hoststlucia.com - URL = "contains" - hoststlucia.com
Action Success = Set Template - Corinth02 and STOP
Failure - no changes from new set up
Apart from a rule name and publish all other entries default to the condition when the rule was new.
The reason I'm using contains is that some referring URLs will have an affiliate ID appended.

This rule, like the others, does not trigger. So as I asked originally, it must be something I am doing wrong. What am I missing here? I need to be pointed in the right direction by somebody please.

Thanks,

Ian C

ianc
Doctor or so they tell me
Beginner Modder
ranks
useravatar
Offline
18 Posts
User info in posts
Administrator has disabled public posting

Re: Chameleon URL Detect

Hi again,

I'll address things one at a time.
In your last e-mail you talk about this setup:

Site: www.hoststlucia.com which has a normal link to http://www.gurubak.slu.biz/
Site: http://www.gurubak.slu.biz/ has Chameleon rules detecting hostnames hoststlucia.com,www.hoststlucia.com AND URL contains  hoststlucia.com

The rule is not succeeding because as far as Joomla and Chameleon are concerned, the site IS www.gurubak.slu.biz. It's not www.hoststlucia.com because that site is the referrer, not the current host.

In Chameleon, the Domain Name(s) and URL detection fields are there to detect what's in the HTTP request that comes through to Joomla. If you have clicked on a link to http://www.gurubak.slu.biz/ then the HTTP request contains hostname www.gurubak.slu.biz and a GET request for "/" which put together give a request URL of http://www.gurubak.slu.biz/. If the link was from www.hoststlucia.com then in most cases (with some exceptions) the request will contain a "referrer" value of http://www.hoststlucia.com/ so Joomla can use that to detect what the original referring page/site was.

There are different ways of setting up parked domains etc, and different hosting setups (Plesk vs cPanel) may have different terminology for it. On cPanel there is something called Parked Domains which is when you can have more than 1 domain pointing to exactly the same folder on the server.

That is, the server may have a file structure called /home/stlucia/htdocs/ into which you place your Joomla installation. In cPanel you would have set up your main domain as stlucia.com and use that to access your site. You can then add a "parked domain" of www.gurubak.slu.biz. When you visit that domain, the web server goes to exactly the same files in your web space. Not a sub-folder. Not a redirect from some other hosting space. Not a frame or an iframe. The EXACT same folder on the same server.

This also requires DNS to be set up correctly, so that gurubak.slu.biz and www.gurubak.slu.biz have an A-record with the same IP address as stlucia.com, or perhaps a CNAME to stlucia.com. You should not set this up as a hosted redirect which I think you may have tried.

Normally if you set all this up in Joomla, Joomla won't distinguish between the 2 domain names, and would always show exactly the same pages, menus, modules, layout etc regardless of which domain name you used to view the site. With Chameleon however you can make different stuff happen depending on which domain name (URL) people used to view the site.

Does that make more sense?

Another invaluable tool for you is Chameleon's Debug mode. Go into the Chameleon Options panel and turn on debugging. Then when you view a page on the site you'll see all the checks that Chameleon performs, and you'll see why the rule is succeeding or failing. This would probably have given you a clue that the domain name you thought it was going to was not actually what Joomla was receiving in the request.

I trust that helps.
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
3319 Posts
User info in posts
Administrator has disabled public posting

Re: Chameleon URL Detect

And by the way, apparently in Plesk parked domains are called "Domain Aliases" so that's what you need to set up after you have the DNS set up correctly.

Cheers
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
3319 Posts
User info in posts
Administrator has disabled public posting

Re: Chameleon URL Detect

Hi Stephen,

We've been working with Plesk for about 10 years or so for our selected clients so "domain alias" and "parked domains" are familiar.

This has now moved on and I need to check (via the Plesk config) what happens to "aliased/parked" domains and what they send as an "IIS Host Header" - I think that's what you are trying to capture with the "referrer" option.

Bless you for your help and I know you are very busy with "dev" and support.

The link I described earlier now changes the template on the home page when referring from our home site - www.hoststlucia.com. Parked, alias or whatever you want to call them still don't seem to send a sensible "IIS Host Header" slug. That is progress, not much but progress.

Don't worry, I will talk to you soon when I have worked out what aliased domains sent to the main site.

I also need to clarify, in my own mind, the logic chain of your rules and how you are processing those rules.

We are a hosting ISP so we have the benefit of setting up "crash and burn" sites to work out what is happening.

Strangely, Mightysites had no problem with any "IIS host header slug" it  just couldn't handle database synchronization. Hence the lateral jump to Chameleon.

I'll update you soon and, maybe, write a getting started, but only after I've reviewed your documentation properly.

Be Lucky.

Thanks,

Ian C

ianc
Doctor or so they tell me
Beginner Modder
ranks
useravatar
Offline
18 Posts
User info in posts
Administrator has disabled public posting

Re: Chameleon URL Detect

Hi, Just Thinking,

If I put hoststlucia.com in the "Domain name(s) the rule fails and there is no more processing on subsequent conditions within that specific rule.

So it is not an "if then else"  it is more like a case statement - if you are familiar

Pseudo code

Begin Case
Case Domain name(s) <> ""
   DO code
Case Page URL <> ""
  DO Code
Case Referrer <>""
  DO code
Case 1
  Do jack shit
End Case

and if one of these condition is met the the logic drops down to the "end case" statement, all following statements below the "true condition" are ignored. The binary logic has been fulfilled and returned a status = 1

is that fairly close to the logic? It would seem so from the DEBUG for Chameleon. Not an if then else situation.

Have a good day.

Thanks,

Ian C

ianc
Doctor or so they tell me
Beginner Modder
ranks
useravatar
Offline
18 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1674
Total Polls:
6
Total Posts:
5917
Total Posts Today:
5
User Info:
 
Total Users:
11536
Newest User:
lucero1247
Members Online:
4
Guests Online:
172


Forum Legend:

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