#1 September 30, 2014 2:31pm

dynaread
Member
Registered: August 21, 2014
Posts: 16

Working with www. and clean domain: how to deliver consistent style

Dear Team and BigTreeCMS Colleagues:

We have configured the /environment.php to reference $bigtree["config"]["domain"] = "http://www.examplesite.com"; everywhere.

When we call http://www.examplesite.com, BigTree will nicely serve the homepage, with homepage layout/styling.
But when we call http://examplesite.com, BigTree serves the contents inside our regular contents template layout/styling.

How can we fix this?

Hope to hear from you, with warm regards,

Hans

Offline

#2 September 30, 2014 2:33pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: Working with www. and clean domain: how to deliver consistent style

That's very strange. So the URL without www. provides the same homepage database content but in a different layout?

Offline

#3 September 30, 2014 3:42pm

dynaread
Member
Registered: August 21, 2014
Posts: 16

Re: Working with www. and clean domain: how to deliver consistent style

Yes, Tim, you can see it here...
*** You have to config your hosts file

== URLs REMOVED ==

Thanks for checking up on this. Eager to hear your thoughts...

Hans

Last edited by dynaread (October 1, 2014 9:49am)

Offline

#4 September 30, 2014 3:52pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: Working with www. and clean domain: how to deliver consistent style

Wow, that's incredibly strange. Can you do a print_r($_GET); at the top of /site/index.php so that I can see what environment variables BigTree thinks exist on the two domains? BigTree's routing should come through as $_GET["bigtree_htaccess_url"] so I'm curious what the two different domains are receiving there.

Offline

#5 September 30, 2014 4:04pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: Working with www. and clean domain: how to deliver consistent style

I'll email you a drop-in debug index.php that can help diagnose it. No hurry -- I respond a little slower after work hours but I'll get back to you tomorrow morning if you don't hear from me tonight.

Offline

#6 September 30, 2014 4:11pm

dynaread
Member
Registered: August 21, 2014
Posts: 16

Re: Working with www. and clean domain: how to deliver consistent style

www.thissite.com/site/index.php RESULTS = Array ( [bigtree_htaccess_url] => ) Array ( [0] => )
thissite.com/site/index.php RESULTS  = Array ( [bigtree_htaccess_url] => ) Array ( [0] => )

Sadly not much difference here, Tim...

Last edited by dynaread (October 1, 2014 9:48am)

Offline

#7 September 30, 2014 4:12pm

dynaread
Member
Registered: August 21, 2014
Posts: 16

Re: Working with www. and clean domain: how to deliver consistent style

You can test yourself. I left the /site/index.php you provided on the server...

Offline

#8 October 1, 2014 9:24am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: Working with www. and clean domain: how to deliver consistent style

Wow, that's incredibly strange. Without getting in there and debugging it in depth my advice would be to use an .htaccess redirect to force a domain.
Oddly, when I visit the site this morning I'm now seeing the same content at both with and without www. -- did you change anything?

Offline

#9 October 1, 2014 9:47am

dynaread
Member
Registered: August 21, 2014
Posts: 16

Re: Working with www. and clean domain: how to deliver consistent style

Hello Tim:

Turned out, the problem was in our own BigTree coding/deployment. Our Senior Engineer wrote this...

Hans, I understand the cause of this issue, and learned about the new Bigtree variable “bigtree_htaccess_url.” I now use that to identify homepage. Earlier we were comparing to WWW_ROOT url, which triggered the issue.

Hope this will be helpful for other developers too, Tim. You didn't see the problem anymore, because it has been resolved overnight.

Thanks so much for coaching us: Very much appreciated. We love BigTree. It is a most flexible and super clean platform,

Hans

Offline

#10 October 1, 2014 9:48am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: Working with www. and clean domain: how to deliver consistent style

Glad you got it worked out and thanks for the kind words! Enjoy BigTree!

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.