Skip to content

Instantly share code, notes, and snippets.

@putzflorian
Last active August 29, 2015 13:57
Show Gist options
  • Save putzflorian/9407893 to your computer and use it in GitHub Desktop.
Save putzflorian/9407893 to your computer and use it in GitHub Desktop.
HTTPS umleitung Action Controller
<?php
$document_path = $this->_request->getPathInfo();
if(!Pimcore_Tool::isFrontentRequestByAdmin()){
$pos = strpos($document_path, '/' . $this->language . '/tosc4');
if($pos === false && $_SERVER['SERVER_PORT'] == 443){
Pimcore_Model_Cache::disable();
$this->_redirect('http://www.domain.at' . $document_path, array('code' => 301));
}
if($pos !== false && $_SERVER['SERVER_PORT'] != 443){
Pimcore_Model_Cache::disable();
$this->_redirect('https://www.domain.at' . $document_path, array('code' => 301));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment