Index: t3lib/utility/class.t3lib_utility_http.php
===================================================================
--- t3lib/utility/class.t3lib_utility_http.php (revision 9047)
+++ t3lib/utility/class.t3lib_utility_http.php (working copy)
@@ -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 9047)
+++ typo3/sysext/cms/ext_tables.php (working copy)
@@ -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.stay_in_context', 0),
+ array('LLL:EXT:cms/locallang_tca.xml:pages.url_scheme.http', 1),
+ array('LLL:EXT:cms/locallang_tca.xml:pages.url_scheme.https', 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 9047)
+++ typo3/sysext/cms/locallang_tca.xml (working copy)
@@ -22,6 +22,10 @@
+
+
+
+
Index: typo3/sysext/cms/ext_tables.sql
===================================================================
--- typo3/sysext/cms/ext_tables.sql (revision 9047)
+++ typo3/sysext/cms/ext_tables.sql (working copy)
@@ -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 9047)
+++ typo3/sysext/cms/tslib/class.tslib_fe.php (working copy)
@@ -982,6 +982,23 @@
$this->pageNotFoundAndExit($pNotFoundMsg[$this->pageNotFound]);
}
+ if ($this->page['url_scheme'] > 0) {
+ $newUrl = '';
+ $requestUrlScheme = parse_url(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), PHP_URL_SCHEME);
+ if ((int) $this->page['url_scheme'] === t3lib_utility_http::SCHEME_HTTP && $requestUrlScheme == 'https') {
+ $newUrl = 'http://' . substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), 8);
+ } elseif ((int) $this->page['url_scheme'] === t3lib_utility_http::SCHEME_HTTPS && $requestUrlScheme == 'http') {
+ $newUrl = 'https://' . substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), 7);
+ }
+ 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 9047)
+++ typo3/sysext/cms/tslib/class.tslib_content.php (working copy)
@@ -6736,15 +6736,19 @@
$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;
- }
+ 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 = ((int) $page['url_scheme'] === t3lib_utility_http::SCHEME_HTTP) ? 'http' : 'https';
}
+
+ // If no domain records are defined, use current domain:
+ if ($targetDomain === '' && $conf['forceAbsoluteUrl'] ||
+ $absoluteUrlScheme !== parse_url(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), PHP_URL_SCHEME)) {
+ $targetDomain = $currentDomain;
+ }
}
// If target page has a different domain and the current domain's linking scheme (e.g. simulateStaticDocuments/RealURL/...) should not be used