Project

General

Profile

Actions

Bug #97709

closed

Cannot generate absolute URL with uriBuilder

Added by Florian Rival almost 2 years ago. Updated almost 2 years 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
Actions #1

Updated by Florian Rival almost 2 years ago

  • Category set to Extbase
Actions #2

Updated by Georg Ringer almost 2 years 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

Actions #3

Updated by Florian Rival almost 2 years 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.

Actions #4

Updated by Georg Ringer almost 2 years ago

  • Status changed from Needs Feedback to Closed
Actions

Also available in: Atom PDF