Feature #18498
closedconfig.baseURL with stdWrap support
Added by Jonas Felix over 16 years ago. Updated about 6 years ago.
0%
Description
The config.baseURL setting should be processed by stdWrap.
This way it's possible to get the base URL out from the environment variables with getText (.data) or from a extension (postUserFunc). And all the other good things stdWrap serves.
(issue imported from #M7937)
Files
realurl.diff (2.09 KB) realurl.diff | Administrator Admin, 2008-07-18 14:43 | ||
processBaseUrlHook.diff (1.16 KB) processBaseUrlHook.diff | Administrator Admin, 2009-05-15 23:24 |
Updated by Benni Mack over 16 years ago
Hey.
I think that this is a bad idea. there were some reasons why config.baseURL = 1 was removed.
I think it took the t3ilb_INDPVAR -- HTTP_HOST and it had some problems, as any hostname is then possible. I wouldn't recommend it.
Updated by Benni Mack over 16 years ago
Maybe we can ask in the dev-list about that feature?
Updated by Jonas Felix over 16 years ago
I checked this in depth and I know what's the problem.
I'm not asking for doing a =1 auto detection version, but a more comfortable way to configure it.
Like a comma separated list would be very good. This way you have to define the domains, but you don't have to do a lot of conditions and coding.
something like:
config.baseURL = typo3.org,typo3.com,www.typo3.org,www.typo3.com
Updated by Benni Mack over 16 years ago
I see the issue. However, I'd rather have a
config.baseURL = 1
and then it does the following:
get all domain records in this rootline, and checks for them with the HTTP_HOST. If none matches, the first domain should be taken. How about this?
Also, I think I'm personally gonna stick to
config.absRefPrefix = /
for my installations now. I never liked baseURL much.
Updated by Benni Mack over 16 years ago
Yeah, but quite a change in functionality. Maybe you want to ask Dmitry (with his RealURL experience) what he thinks of the idea.
Also, are you willing to create a patch for that?
Updated by Jonas Felix over 16 years ago
I would do so if it has a chance to get into core.
Does the config.absRefPrefix = / work without baseURL? I will check that out, I think that's an even better solution for us.
What's the drawbacks of absRefPrefix?
Updated by Benni Mack over 16 years ago
Hey Jonas,
I found out that absRefPrefix has a couple of drawbacks, as some parts of the Core and some extensions have problems with that.
See my article on that:
http://www.typo3tricks.com/when-switching-from-baseurl-to-absrefprefix/
Updated by Jonas Felix over 16 years ago
Cool, thank you for the link, will check that.
Updated by Michael Stucki over 16 years ago
Hi guys,
introducing stdWrap for config.* properties is currently not possible because of the way how "config" and page-specific config-objects like "page.config" are merged. Solution is probably to change the handling in class.tslib_fe.php, lines 2028ff (Trunk).
Besides this, I propose the attached patch which integrates all hostnames that are configured in the RealUrl configuration. Usage:
config.baseURL = useRealUrl:www.defaulhost.com
whereas www.defaulthost.com is the fallback if no match was found.
The patch works well but I don't like to integrate it as it is right now. The handling should be controlled through a hook instead.
Feel free to take care of it!
Updated by Nico de Haen over 15 years ago
Here is a hook patch, created at the T3DD09 Bug night. See attached processBaseUrlHook.diff
Updated by Ernesto Baschny over 15 years ago
I think if you doesn't add the baseUrl as an "USER_INT" kind of object, the hook will not work as expected. As soon as TYPO3 caches the page, the hook won't be called anymore for this particular page. So if you set the baseHref based on the client's request, it will be cached for every further requests.
at least I think! :)
Updated by Nico de Haen over 15 years ago
I tested it and Ernesto is right. The baseHref is cached and is not accessible by the hook any more. So I would suggest NOT to include this hook. IMHO the best practice for multi domain pages is to set the baseUrl in Typoscript conditions, then different pages are cached for each condition. Then we don't need this feature at all (and can close this feature request?)
Updated by Ernesto Baschny over 15 years ago
As Nico found out, this hook won't work anyway. So this issue is closed now until someone finds a new need for something that is not doable with regular domain-matching typoscript conditions.
Updated by Michael Stucki over 15 years ago
@Ernesto: Please use status "resolved" rather than "closed". I think it can't be reopened by users otherwise.