Project

General

Profile

Actions

Feature #18498

closed

config.baseURL with stdWrap support

Added by Jonas Felix over 16 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2008-03-25
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.2
Tags:
Complexity:
Sprint Focus:

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

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #19244: config.baseURL does not support stdWrap or copying of ObjectsClosed2008-08-21

Actions
Actions #1

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.

Actions #2

Updated by Benni Mack over 16 years ago

Maybe we can ask in the dev-list about that feature?

Actions #3

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

Actions #4

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.

Actions #5

Updated by Jonas Felix over 16 years ago

That's an even better idea.

Actions #6

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?

Actions #7

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?

Actions #8

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/

Actions #9

Updated by Jonas Felix over 16 years ago

Cool, thank you for the link, will check that.

Actions #10

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!

Actions #11

Updated by Nico de Haen over 15 years ago

Here is a hook patch, created at the T3DD09 Bug night. See attached processBaseUrlHook.diff

Actions #12

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! :)

Actions #13

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?)

Actions #14

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.

Actions #15

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.

Actions #16

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF