Bug #15438
closed[TS] Condition hostname doesn't work
0%
Description
config.baseURL = http://web-me.org/
[hostname = www.web-me.org]
config.baseURL = http://www.web-me.org/
[global]
TYPO3 3.8.1
config.baseURL = http://web-me.org/
[globalString = HTTP_HOST=www.web-me.org]
config.baseURL = http://www.web-me.org/
[global]
geht auch nicht
(issue imported from #M2300)
Updated by Frank H¼ttner almost 19 years ago
falsche Kategorie [tx_timtab]
es gehört zu [TYPO3 Core]
Updated by Frank H¼ttner almost 19 years ago
Solution:
config.baseURL = http://web-me.org/
[globalString = IENV:HTTP_HOST=www.web-me.org]
config.baseURL = http://www.web-me.org/
[global]
Updated by Wolfgang Klinger over 18 years ago
take a look at your server's hosts file
and try the condition with
[hostname = web-me.org]
(without 'www')
Updated by Juraj Sulek over 18 years ago
I had this same problem and the reason was that function gethostbyaddr () has on my server returned IP and not hostname. Maybe there can be done a patch. If this function return IP use the HTTP_HOST variable.
Updated by Joerg Schoppet over 18 years ago
Perhaps I understand something completely wrong, but the condition hostname looks for the REMOTE_ADDR!
On my system REMOTE_ADDR always have the client-ip-address.
And this is COMPLETELY WRONG!
Updated by Steffen Kamper about 16 years ago
It's not wrong, as the function t3lib_div::cmpFQDN is used which expects an IP
But the method gethostbyaddr() is wrong here.
If you have a server with one IP and several domains it's obvious that the result of gethostbyaddr doesn't match with the domain you called. So the comparison should be changed to compare against HTTP_HOST
Please test attached patch (against trunk) which works for me.
Updated by Steffen Kamper about 16 years ago
I'm totally wrong!
hostname is the client hostname.
Description in doc:
"The values are compared with the fully qualiteid hostname of getenv(“REMOTE_ADDR”) retrieved by PHP."
So this is used to filter user's hostname, eg match all users with IP from t-online.
I agree that the description may mislead (i was misleaded too).
For HTTP_HOST the official way is to use IENV:HTTP_HOST
As this is not as comfortable like hostname (use a comma list) I will make a patch for 4.3 and introduce a new variable "servername" which compares with HTTP_HOST