[Typo3] Interesting problem with baseURL

Joseph Mesterhazy jmesterh at iastate.edu
Tue Aug 30 17:13:26 CEST 2005


Hello all,

So I have had this bug with my web sites, off and on, where suddenly  
my pages would lose all the formatting, eg. it couldn't find the CSS  
code. I just found out why, and it has to do with baseURL.

In my template setup, I have "config.baseURL = 1" because the links  
in my templates are relative to keep them as generic as possible.  
This works fine, usually. But sometimes I noticed that suddenly  
instead of the "base href" being the URL of the web server, it was  
either blank, or had a completely random hostname in there that I  
have never heard of.

As it turns out, it has to do with spiders and page caching. Normal  
web browsers are sending out the site URL with their HTTP GET  
request, and that is what is being inserted by Typo3 in the baseURL  
(I presume). But some spiders, and I guess perhaps other web  
browsers, are not setting this correctly, and they are hitting my  
site after the page cache is expired. So the cache is regenerated  
with a bogus baseURL reference and that page is broken until I clear  
its cache and reload it with a standard web browser.

I know I can set baseURL = http://sitename and be done with it,  
however I plan on using this same template for multiple domains in  
the same server. Is there something I am missing, or will I be forced  
to set "baseURL =" for every new domain, in an extension template for  
each domain?

I wonder if anyone else has experienced this problem?

Thanks,

Joe
--
Joe Mesterhazy
ECpE UNIX Administrator
2101 Coover Hall, Iowa State University
Ames, IA 50011.  (515) 294-7359
http://www.mesterhazy.net




More information about the TYPO3-english mailing list