Last active
August 29, 2015 13:56
-
-
Save AydinHassan/9110876 to your computer and use it in GitHub Desktop.
This file contains 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 | |
require_once __DIR__ . '/app/code/local/Nivea/Mobile/Model/Device/Detect.php'; | |
$mobile = new Nivea_Mobile_Model_Device_Detect(); | |
$isMobile = $mobile->isMobile(); | |
$currentUrl = $env = ($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']; | |
$scheme = isset($_SERVER['HTTPS']) ? 'https://' : 'http://'; | |
if ($isMobile && $currentUrl == 'shop.nivea.co.uk') { | |
$url = $scheme . "mobileshop.nivea.co.uk"; | |
header("Location: $url"); | |
exit; | |
} | |
if(!$isMobile && $currentUrl === 'mobileshop.nivea.co.uk') { | |
$url = $scheme . "shop.nivea.co.uk"; | |
header("Location: $url"); | |
exit; | |
} | |
require_once __DIR__ . '/index.php'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment