Issue Bug Closed

#97709Cannot generate absolute URL with uriBuilder

Florian Rival 05/30/22, 15:08 updated 05/31/22, 19:33

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.