5 * configuration to copy to settings.php to make securepages and mobile_tools work together.
7 * This snippet works for secure pages, that only differ from the non-secure
8 * one, in using https:// instead of http://. For other configurations you
9 * might need to change the snippet.
12 // Let mobile tools work with secure pages.
13 // We have to set the base_url too, so e.g. globalredirect will not force a
16 $desktop_url = 'www.example.com';
17 $mobile_url = 'm.example.com';
19 $secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on');
21 // On mobile requests, mobile path provide the secure settings.
22 if ($_SERVER['HTTP_HOST'] == $mobile_url) {
23 $conf['securepages_basepath'] = "http://$mobile_url";
24 $conf['securepages_basepath_ssl'] = "https://$mobile_url";
25 $base_url = ($secure) ?
"https://$mobile_url" : "http://$mobile_url";
28 $conf['securepages_basepath'] = "http://$desktop_url";
29 $conf['securepages_basepath_ssl'] = "https://$desktop_url";
30 $base_url = ($secure) ?
"https://$desktop_url" : "http://$desktop_url";
33 // On secure pages, mobile and desktop urls are https urls.
35 $conf['mobile_tools_mobile_url'] = "https://$mobile_url";
36 $conf['mobile_tools_desktop_url'] = "https://$desktop_url";
39 $conf['mobile_tools_mobile_url'] = "http://$mobile_url";
40 $conf['mobile_tools_desktop_url'] = "http://$desktop_url";