[TYPO3-dev] realurl and redirects

Steffen Kamper steffen at sk-typo3.de
Wed May 14 14:49:33 CEST 2008


"Martin Kutschker" <martin.kutschker-n0spam at no5pam-blackbox.net> schrieb im 
Newsbeitrag 
news:mailman.1.1210768732.31087.typo3-dev at lists.netfielders.de...
> Steffen Kamper schrieb:
>> Hi,
>>
>> i encountered a problem with redirect and realurl. It was on 4.0.1, but 
>> may be it exists on later versions too.
>> The problem was that
>> $redirectUrl = $this->pi_getPageLink($this->piVars['backPid']);
>> header('location:'.$redirectUrl);
>>
>> leads to wrong urls as some pagesegments were repeated.
>> Using this fixed it:
>>
>> $redirectUrl = $this->pi_getPageLink($this->piVars['backPid']);
>> header('location:'.t3lib_div::locationHeaderUrl($redirectUrl));
>>
>> I stumbled why that happens as i thought i will be save any time using 
>> typolink-functions.
>>
>> Can this be confirmed?
>
> I can confirm that you were using the header() function call wrong. :-)
>
> Always send a full URI including the protocol in a location header. This 
> is was t3lib_div::locationHeaderUrl() ensures as pi_base::pi_getPageLink() 
> only returns an internal link.
>
> Masi

thanks for that hint ;-)

vg Steffen 






More information about the TYPO3-dev mailing list