Some additional description on installation and configuration, mentioning the blogpost
[sandbox/derhasi/1399172.git] / default.settings.inc
1 <?php
2
3 /**
4 * @file
5 * configuration to copy to settings.php to make securepages and mobile_tools work together.
6 *
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.
10 */
11
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
14 // wrong redirect.
15
16 $desktop_url = 'www.example.com';
17 $mobile_url = 'm.example.com';
18
19 $secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on');
20
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";
26 }
27 else {
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";
31 }
32
33 // On secure pages, mobile and desktop urls are https urls.
34 if ($secure) {
35 $conf['mobile_tools_mobile_url'] = "https://$mobile_url";
36 $conf['mobile_tools_desktop_url'] = "https://$desktop_url";
37 }
38 else {
39 $conf['mobile_tools_mobile_url'] = "http://$mobile_url";
40 $conf['mobile_tools_desktop_url'] = "http://$desktop_url";
41 }