Override configuration for interface (different ways for different hosts)

Events happening in the community are now at Drupal community events on www.drupal.org.
epiraces's picture

Hi all,

I am looking for some advice. I am trying to make a D5 implementation have 2 different behavior depending on the host.

if ($_SERVER['HTTP_HOST'] == 'www.host.org' || $_SERVER['HTTP_HOST'] == 'host.org'){
$conf['i18n_translation_links'] = 0;
}elseif($_SERVER['HTTP_HOST'] == 'admin.host.org'){
$conf['i18n_translation_links'] = 1;
}

Does this make sense? Is there a better way to accomplish this?

Thanks!

Comments

Domain Access

gnat's picture

You should have a look at the Domain Access module:
http://drupal.org/project/domain

It allows for the idea of distinct sites, with a shared and separate data. The version for D5 works well, and holds up well in real use.

DrupalCampNYC and your presentation

kbell's picture

Hi gnat,
I am greatly looking forward to pestering you with questions this next Saturday, as this coming weekend is my only window to really get things set up and working properly for my new developer team, all of whom are coming on board one week from today.

I am trying to set up multisite/multistage using drush/domain access and/or Capistrano to be used in a Cloud Sites-based (Mosso - no SSH) hosting environment. I am desperately trying to do this the right way to maximize efficiency and code reuse potential, and to cut our maintenance and upgrade times to a minimum. My company is about to explode in terms of active Drupal sites we need to manage/maintain/develop, and if I don't get it right now I will spend months trying to catch up and whip everything into shape, losing valuable time and onboarding training in the process. All of my developers have Drupal experience, but most are not aware of nor follow Drupal best practices, so I am desperately trying to instill the right SOPs from the start. If I keep changing the rules on them, they're just going to be confused, think I'm full of it, and lapse into bad habits. Unfortunately, I'm one of those people who has to learn by doing, and a pod- or screen-cast just usually won't do it for me for something with this many moving parts, unless there's some kind of step-by-step follow along component.

Any advice I can beg, borrow, barter or bribe (alcoholic beverages of your choice?) to enlist your help with this is GREATLY appreciated. The only thing I can promise you is that I will pay it forward on the reg - I always pass on whatever I learn freely. I will do presentations, create screencasts, talk to people over coffee, on IRC, at meetings, on the phone, in the middle of the night - whatever I can do to help others struggling with the same issues, once I get these practices down firsthand.

So - thank you in advance for being willing to present next Saturday - you sharing your knowledge is going to be a lifesaver for me and my team.

Warmest regards,
Kelly Bell

--Kelly Bell
Gotham City Drupal
twitter: @kbell | @gothamdrupal
http://drupal.org/user/293443

Thanks gnat, I'll check the

epiraces's picture

Thanks gnat, I'll check the module. We have some code that deals with server/hosts config, and thought that a few lines of code may have less of an impact. I tired to sett this on settings.php but no real luck.

I think you better follow

jose reyero's picture

I think you better follow this approach, and set any variable you want for each site.

http://drupal.org/node/339381

Thanks :-)

epiraces's picture

I useda different settings.php per domain and that seem to did the trick. :-) Thanks!