So I am curious if someone is using Acquia's Cloud hosting, with the 3 environments (Dev, Stage, Prod) and use Secure Pages.

I am having some difficulty when I am trying to update my Dev and Staged environments. When I go to log into the site in those environments, I get redirected to the live site's admin panel, and I can't get back. It's a real pain to do, but I can turn off Secure Pages in the database but it that tends to cause more harm then good.

So with setups were there are multiple environments, different URL's for each, how are people handling this? Is it something that you need to just setup in your local /etc/hosts file? Not sure what to do but I haven't been using the environment setups because of Secure Pages and the URL redirect that takes place.

Comments

TravisJohnston’s picture

Not a huge issue, currently I have begun disabling secure pages on the server with "drush dis securepages" then clearing the cache before I load any other environment. But curious too see what others are doing.

adammalone’s picture

You could use a switch/case if/else statement in settings.php to definitively alter some of the securepages variables:

Something similar to the following may work:

if (isset($_ENV['AH_SITE_ENVIRONMENT'])) {
  switch ($_ENV['AH_SITE_ENVIRONMENT']) {
    case 'dev':
      $conf['securepages_basepath'] = 'http://dev.example.com';
      $conf['securepages_basepath_ssl'] = 'https://dev.example.com';
      break;

    case 'test':
      $conf['securepages_basepath'] = 'http://test.example.com';
      $conf['securepages_basepath_ssl'] = 'https://test.example.com';
      break;

    case 'prod':
      $conf['securepages_basepath'] = 'http://example.com';
      $conf['securepages_basepath_ssl'] = 'https://example.com';
      break;
  }
}
mariagwyn’s picture

This works perfectly.

hessam61’s picture

typhonius solution didn't work for me on Acquia. I also tried

$conf['securepages_enable'] = FALSE;

In my settings.php, but seems like Acquia ignores these variables in settings.php?

adammalone’s picture

morx, be sure to use the snippet pasted above after the Acquia require line in settings.php. If you're still having no luck, please open a support ticket and refer to this thread.

tengoku’s picture

i use tada!! for this and script drush tadaa-fix using acquia cloud hook