Skip to content

TYPO3 targetDomain at rootpage #629

@bernd-reindl

Description

@bernd-reindl

Hello,

i have an RealURL configuration, where the URL is created like this:
www.domain.tld/path/

The function encodeUrl returns '/' als path for the rootpage and set [/] => urlPrependValue to $urlPrependRegister.
TYPO3 prepends the targetDomain to this url an calls postProcessEncodedUrl
postProcessEncodedUrl remove the domain with the preg_replace function and the result is an empty string, because the first "/" after the domain was removed.

So
if (isset(self::$urlPrependRegister[$testUrl]))
failes, because testUrl is ''(empty) and not '/' like in the urlPrependRegister.

This only happens at the rootpage, because other pages have no prepending '/'.
[somepath/] => urlPrependValue

To solve this problem, i add this code to the UrlEncode.php after the preg_replace

if($testUrl === '')
                $testUrl = '/';

Find my modifications in UrlEncoder.php by searching for [BEGIN]Added by Reindl
UrlEncoder.zip

Debuginfo

Array
--
  | (
  | [finalTagParts-url] => https://www.starpumpalliance.com/
  | [testUrl] =>
  | [urlPrependRegister] => Array
  | (
  | [/] => https://de.starpumpalliance.com
  | )
  |  
  | )


Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions