Bug #97709

Cannot generate absolute URL with uriBuilder

Added by Florian Rival 2 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2022-05-30
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

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
#1

Updated by Florian Rival 2 months ago

  • Category set to Extbase
#2

Updated by Georg Ringer 2 months ago

  • Status changed from New to Needs Feedback

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

#3

Updated by Florian Rival 2 months ago

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.

#4

Updated by Georg Ringer 2 months ago

  • Status changed from Needs Feedback to Closed

Also available in: Atom PDF