[TYPO3-dev] redirect from domain vs. subdomain: different treatment - how to solve?
grac
grac at gmx.ch
Mon Jan 19 07:34:48 CET 2009
hi
i happened to stumble over an incomprehensive behaviour of typo3
treating redirected subdomains differently from redirected domains.
it occured when i changed the settings of one of my new projects (which
was in a special subdomain during development) to it's own domain in
order to publish it.
that can happen quite often:
you have a client with an existing website, located at his webhoster.
he wants a renovation of his website and therefore wants to keep his domain.
you develop the new website in a subdomain, and when everything is
ready, you only have to change the DNS pointer to your webhoster (after
having created a domain on your webhoster with the same URL and having
changed everything necessary in the respective root).
i have several projects in different states of development.
and since i use the single-tree multi-domain solution, i can compare how
differently typo3 reacts to redirected subdomains and redirected domains.
to make it clear, here my configuration (typo3 4.2.3, templavoila 1.3.7,
cooluri 2.0.2):
my typo3 installation is located at:
DOMAIN-TYP3INSTALLATION / subdomain-typo3 /
redirects to the above:
DOMAIN-WEBSITE1 /
DOMAIN-WEBSITE1 / subdomain-website2 /
DOMAIN-WEBSITE1 / subdomain-website3 / (moved to --->)
DOMAIN-WEBSITE3 /
redirects on my webserver are done with setting the documentRoot of
websites 1-3 to --> / subdomain-typo3 /
works perfectly, is handy, clear and easy to work with.
but typo3 makes a difference in building the (internal) URL:
subdomains:
subdomain-website2 / stays --> / subdomain-website2 /
as was during development:
subdomain-website3 / stays --> / subdomain-website3 /
DOMAINS:
DOMAIN-WEBSITE1 / becomes ---> / subdomain-typo3 / index.php?id=xxx
DOMAIN-WEBSITE3 / becomes ---> / subdomain-typo3 / index.php?id=yyy
all domains are set correctly.
all roots are set correctly.
all config.baseURL are set correctly.
all userBaseUrl are set correctly (COOLURI)
all config.typolinkCheckRootline are set (= 1)
all config.enableLinksAcrossDomains are set (= 1)
.htaccess is set correctly (as far as i know)
and from FE nothing wrong is seen.
this for me uncomprehensive behaviour of typo3
- can be seen within the respective Crawler logs, which report sometimes
quite a few errors from Cron Daemon, more or less randomly (parse_url,
fsockopen), which is quite annoying
- has severe consequences for example with tcdirectmail (preview is not
possible; explanation in the manual: "You are using RealURL and the
domain and baseURL are different. They must be equal if tcdirectmail are
to encode the pictures correctly." - which is exactly what happens with
DOMAIN-WEBSITE1 and DOMAIN-WEBSITE3, but not with subdomain-website2).
i have done my research in every possible source, but have not found any
single remark on that phenomenon nor any hint or tip on how to prevent
typo3 from doing this.
so any help from the experts is welcome
thanks in advance
stephan
More information about the TYPO3-dev
mailing list