Index: t3lib/utility/class.t3lib_utility_http.php =================================================================== --- t3lib/utility/class.t3lib_utility_http.php (Revision 8768) +++ t3lib/utility/class.t3lib_utility_http.php (Arbeitskopie) @@ -78,6 +78,10 @@ const HTTP_STATUS_504 = 'HTTP/1.1 504 Gateway Timeout'; const HTTP_STATUS_505 = 'HTTP/1.1 505 Version Not Supported'; + // URL Schemes + const SCHEME_HTTP = 1; + const SCHEME_HTTPS = 2; + /** * Sends a redirect header response and exits. Additionaly the URL is * checked and if needed corrected to match the format required for a Index: typo3/sysext/cms/ext_tables.php =================================================================== --- typo3/sysext/cms/ext_tables.php (Revision 8768) +++ typo3/sysext/cms/ext_tables.php (Arbeitskopie) @@ -143,6 +143,19 @@ 'default' => '0' ) ), + 'url_scheme' => array ( + 'exclude' => 1, + 'label' => 'LLL:EXT:cms/locallang_tca.xml:pages.url_scheme', + 'config' => array ( + 'type' => 'select', + 'items' => array ( + array('LLL:EXT:cms/locallang_tca.xml:pages.url_scheme.I.0', '0'), + array('LLL:EXT:cms/locallang_tca.xml:pages.url_scheme.I.1', '1'), + array('LLL:EXT:cms/locallang_tca.xml:pages.url_scheme.I.2', '2') + ), + 'default' => '0' + ) + ), 'fe_group' => array ( 'exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.fe_group', @@ -583,7 +596,7 @@ $TCA['pages']['palettes'] = t3lib_div::array_merge($TCA['pages']['palettes'],array( '1' => array('showitem' => 'starttime, endtime, extendToSubpages'), '2' => array('showitem' => 'layout, lastUpdated, newUntil, no_search'), - '3' => array('showitem' => 'alias, target, no_cache, cache_timeout'), + '3' => array('showitem' => 'alias, target, no_cache, cache_timeout, url_scheme'), '5' => array('showitem' => 'author, author_email', 'canNotCollapse' => 1) )); Index: typo3/sysext/cms/locallang_tca.xml =================================================================== --- typo3/sysext/cms/locallang_tca.xml (Revision 8768) +++ typo3/sysext/cms/locallang_tca.xml (Arbeitskopie) @@ -22,6 +22,10 @@ + + + + Index: typo3/sysext/cms/ext_tables.sql =================================================================== --- typo3/sysext/cms/ext_tables.sql (Revision 8768) +++ typo3/sysext/cms/ext_tables.sql (Arbeitskopie) @@ -452,6 +452,7 @@ fe_group varchar(100) DEFAULT '0' NOT NULL, subtitle varchar(255) DEFAULT '' NOT NULL, layout tinyint(3) unsigned DEFAULT '0' NOT NULL, + url_scheme tinyint(3) unsigned DEFAULT '0' NOT NULL, target varchar(80) DEFAULT '' NOT NULL, media text, lastUpdated int(10) unsigned DEFAULT '0' NOT NULL, Index: typo3/sysext/cms/tslib/class.tslib_fe.php =================================================================== --- typo3/sysext/cms/tslib/class.tslib_fe.php (Revision 8768) +++ typo3/sysext/cms/tslib/class.tslib_fe.php (Arbeitskopie) @@ -982,6 +982,26 @@ $this->pageNotFoundAndExit($pNotFoundMsg[$this->pageNotFound]); } + if ($this->page['url_scheme'] > 0) { + $newUrl = ''; + if ((int)$this->page['url_scheme'] === t3lib_utility_http::SCHEME_HTTP + && substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), 0, 5) == 'https' + ) { + $newUrl = 'http' . substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), 5); + } elseif ((int)$this->page['url_scheme'] === t3lib_utility_http::SCHEME_HTTPS + && substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), 0, 4) == 'http' + ) { + $newUrl = 'https' . substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), 4); + } + if ($newUrl !== '') { + if ($_SERVER['REQUEST_METHOD'] === 'POST') { + $headerCode = t3lib_utility_Http::HTTP_STATUS_303; + } else { + $headerCode = t3lib_utility_Http::HTTP_STATUS_301; + } + t3lib_utility_http::redirect($newUrl, $headerCode); + } + } // set no_cache if set if ($this->page['no_cache']) { $this->set_no_cache(); Index: typo3/sysext/cms/tslib/class.tslib_content.php =================================================================== --- typo3/sysext/cms/tslib/class.tslib_content.php (Revision 8768) +++ typo3/sysext/cms/tslib/class.tslib_content.php (Arbeitskopie) @@ -6196,16 +6196,21 @@ } $absoluteUrlScheme = 'http'; - // URL shall be absolute: - if (isset($conf['forceAbsoluteUrl']) && $conf['forceAbsoluteUrl']) { - // If no domain records are defined, use current domain: - if ($targetDomain === '') { - $targetDomain = $currentDomain; - } - // Override scheme: + // URL shall be absolute: + if (isset($conf['forceAbsoluteUrl']) && $conf['forceAbsoluteUrl'] || $page['url_scheme'] > 0) { + // Override scheme: if (isset($conf['forceAbsoluteUrl.']['scheme']) && $conf['forceAbsoluteUrl.']['scheme']) { $absoluteUrlScheme = $conf['forceAbsoluteUrl.']['scheme']; + } elseif ($page['url_scheme'] > 0) { + $absoluteUrlScheme = $page['url_scheme'] == t3lib_utility_http::SCHEME_HTTP ? 'http' : 'https'; } + + // If no domain records are defined, use current domain: + if ($targetDomain === '' && $conf['forceAbsoluteUrl'] || + $absoluteUrlScheme !== substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), 0, strlen($absoluteUrlScheme)) + ) { + $targetDomain = $currentDomain; + } } // If target page has a different domain and the current domain's linking scheme (e.g. simulateStaticDocuments/RealURL/...) should not be used