Bug #35392

Preview links not working if BE is using SSL and websites aren't

Added by Florian Seirer almost 8 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2012-03-30
Due date:
% Done:

0%

TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

We have our Backend running under https://www.someinternaldomain.com/subfolder/, which lead to TYPO3 opening preview pages (Web->View) under https://www.someInternalDomain.com/subfolder/index.php?id=1.

After updating from 4.5.11 to 4.5.14 today, the preview pages were no longer working, because TYPO3 opens the preview pages under https://www.theRealDomain.com/index.php?id=1.
This works only if we had SSL certificates for all domains in our TYPO3 installation, which we don't at this moment.

The websites themselves are still running fine under http. It's only the editors who are affected.

Is this a bug or is there an option to revert to the previous behaviour?
Is Bug #31959 (from 4.5.12) related to this?


Related issues

Related to TYPO3 Core - Feature #36542: Changed domain handling on "View webpage" from backend causes problems Closed 2012-04-25
Duplicates TYPO3 Core - Bug #34820: t3lib_befunc::getViewDomain does not respect http/https scheme Closed 2012-03-14

History

#1 Updated by Florian Seirer almost 8 years ago

To clarify:

What works:
- Viewing a page within the Web/View module
What doesn't work:
- Opening a page via context menu in the page tree
- Opening a page via "Save and view" button

This is still broken(?) in 4.5.15

#2 Updated by Lorenz Ulrich over 7 years ago

I can confirm this. The problem is that the url_scheme is not looked up in the rootline.

Take the following setup:

- www.example.org with url_scheme = 1 (http)
- www.example.org/subpage with url_scheme = default

Now the preview link is generated like this (t3lib_BEfunc::getViewDomain):

$page = (array)$sysPage->getPage($pageId);
$protocol = 'http';
if ($page['url_scheme'] == t3lib_utility_Http::SCHEME_HTTPS || ($page['url_scheme'] == 0 && t3lib_div::getIndpEnv('TYPO3_SSL'))) {
    $protocol = 'https';
}

The url_scheme is not 2 (https), but only the page being linked to is checked for the URL scheme. So url_scheme is 0 (default) and we're running the backend with SSL: The protocol of the link will be https.

So #31959 improved the situation a bit by using the scheme that is set in the page properties, but it still doesn't consider the rootline.

#3 Updated by Lorenz Ulrich over 7 years ago

Same problem in typo3/sysext/viewpage/view/index.php::main.

#4 Updated by Francois Suter over 7 years ago

Hi Lorenz,

Your idea of looking up the rootline looks like a good solution to this issue. If you can prepare a patch, I'll review it.

#5 Updated by Christian Nölle over 7 years ago

I do not think, that walking the rootline will fix this issue with all implications. See http://forge.typo3.org/issues/34820 for further problems with this issue

#6 Updated by Mathias Schreiber about 5 years ago

  • Target version set to 7.4 (Backend)
  • Is Regression set to No

#7 Updated by Wouter Wolters almost 5 years ago

  • Status changed from New to Needs Feedback

Hi, there is an undocumented FEATURE to set an alternative previewDomain in PageTSConfig.

TCEMAIN.viewDomain = example.com

If you have your backend running on https and your frontend not you can specify a protocol in this setting.

TCEMAIN.viewDomain = http://example.com

Does this solve the problem?

#8 Updated by Florian Seirer almost 5 years ago

The problem has been solved, but not with TCEMAIN.viewDomain, iirc.
Anyway, this issue can be closed.

#9 Updated by Riccardo De Contardi almost 5 years ago

  • Status changed from Needs Feedback to Closed

Closed upon the request of the reporter.

Also available in: Atom PDF