#97709Cannot generate absolute URL with uriBuilder
Description
If you try to generate an absolute URL with uriBuilder, you only have a relative URL.
$uri = $uriBuilder
->reset()
->setTargetPageType($pageType)
->setCreateAbsoluteUri(true)
->setTargetPageUid((int)$pageUid);
$absoluteUrl = $uri->build();
$absoluteUrl should have something like this:
https://www.mysite.com/the-page
and it has this instead :
/the-page
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 4
-
Florian Rival changed category 05/30/22, 15:08
-
Georg Ringer commented and changed status
NewNeeds Feedback 05/30/22, 17:38 -
Florian Rival commented 05/31/22, 09:12
You’re right Georg, I didn’t set the full domain name in site configuration, this is the reason why it doesn’t work.
Thanks for your help, you can close this issue. -
Georg Ringer changed status
Needs FeedbackClosed 05/31/22, 19:33
did you provide a full url in the site configuration as entry point? see description
> Main URL to call the frontend in default language. Can be https://www.example.com/ or just /, if it is just a / you cannot rely on TYPO3 creating full URLs