[TYPO3-dev] Reintroducing config.baseURL = 1
Steffen Gebert
steffen.gebert at typo3.org
Wed Sep 28 22:17:34 CEST 2011
Hi,
>> There should be some API to get the domain for a page id. The result of
>> this function should be used as base url, regardless of what is in
>> HTTP_HOST.
>
> So what should the API return if there is no sys_domain record of the
> incoming domain?
Nothing?
Okay, I just looked up a patch, which I created some time ago. There
seems to be no centralized place, where the corresponding domain for a
pid is retrieved. Instead, the magic resides in typolink (and possibly
in some other places, too).
When you look at
http://git.typo3.org/TYPO3v4/Core.git?a=commitdiff;h=ef5555e486e0c141ca9d0d2f71d365bfce7182f3
you can get an impression, how that could look like. Please keep in mind
that this is not official API, yet, and the place, where this function
resides might also be worth an improvement.
However, what I would expect is that when pid X is accessed with
HTTP_HOST A, and TYPO3 has to generate the page/links, it checks calls
getDomainNameForPid(X) and gets back host name B.
Host name A and B don't have to match, but B is used in every case, as
it's the active domain for that page.
I don't know what happens, when no domain is configured. Either take the
risk of cache poisoning, or just die with an exception that
config.baseUrl = 1/auto/whatever does not work without configured domain
records.
Do you agree with this procedure?
>> You can't just trust on the existence of a sys_domain record, as it
>> could be not the primary one (but a redirection) and it might even be
>> defined for another site.
>
> I don't completely understand what you are saying here.
Probably just a misunderstanding, as it's totally clear for you: Don't
just check that a sys_domain record for HTTP_HOST exists, but instead
check that it is really the configured domain name for the currently
accessed page.
Kind regards
Steffen
--
Steffen Gebert
TYPO3 v4 Core Team Member
TYPO3 Server Administration Team Member
TYPO3 .... inspiring people to share!
Get involved: http://typo3.org
More information about the TYPO3-dev
mailing list