Skip to content

Instantly share code, notes, and snippets.

@putzflorian
Last active December 15, 2015 23:59
Show Gist options
  • Select an option

  • Save putzflorian/5343881 to your computer and use it in GitHub Desktop.

Select an option

Save putzflorian/5343881 to your computer and use it in GitHub Desktop.
Website_Controller_Action::init(); Man kann nun also ein Property (https) am Dokument vergeben, ist dieses gesetzt, so ist dieses Dokument per HTTPS erreichbar, ansonsten nicht. Damit ist das Ganze um einiges flexibler und man muss auch nicht immer manuell die .htaccess bzw. apache-config ändern.
// HTTPS Check
if($this->getRequest()->isSecure()) {
if(!$this->document || !$this->document->getProperty("https")) {
$this->_redirect("http://" . $_SERVER["HTTP_HOST"] . $this->getRequest()->getRequestUri());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment