Consider for a moment the following pagetree:
- Website A (root page with domain record a.example.com)
- Page A
- Page A.1
- Page B
- Page C
- Page A
- Website B (root page with domain record b.example.com)
- Page X
- Page Y (mountpoint of "Page A", with content from that page)
- Page X
To generate canonical URLs, I need to get the absolute URL from the original page. I am doing that in a typoscript userfunc on "Page X", but something seems to be wrong:
This returns the uid of Page A, not Page X:
$GLOBALS['TSFE']->page['uid'];
But this does not return the expected URL "a.example.com/page-a/" but rather "b.example.com/page-x/page-y":
$GLOBALS['TSFE']->cObj->typoLink_URL([
'parameter' => $GLOBALS['TSFE']->page['uid'],
'forceAbsoluteUrl' => 1
]);
Obviously, TYPO3 still somehow uses the domain of the page the user is currently on, instead of the original domain where "Page A" is actually located.
For completions sake, here some values I already set in my setup.txt:
config {
absRefPrefix = /
content_from_pid_allowOutsideDomain = 1
typolinkCheckRootline = 1
typolinkEnableLinksAcrossDomains = 1
}
The question is: How can I get the original URL for the uid of Page A?