Created
January 30, 2015 08:27
-
-
Save putzflorian/1c8c8163ee6dbdd54763 to your computer and use it in GitHub Desktop.
SSL redirect for Pimcore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // SSL redirect | |
| if(!$this->editmode){ | |
| if($this->document instanceof Document_Page){ | |
| $domain = 'www.domain.tld'; | |
| if($this->document->getProperty('https') && !$this->getRequest()->isSecure()){ | |
| Pimcore_Model_Cache::disable(); | |
| $this->_redirect('https://' . $domain . $document_path, array('code' => 301)); | |
| } elseif(!$this->document->getProperty('https') && $this->getRequest()->isSecure()){ | |
| Pimcore_Model_Cache::disable(); | |
| $this->_redirect('http://' . $domain . $document_path, array('code' => 301)); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment