I have TYPO3 7.6.18 installed with realURL and two languages (en,fr) on a single tree. the installation is on subdomain fr.mysite.com with bot domains added to the root page. For both languages I need a different subdomain. On first call of en.mysite.com I need to redirect to fr.mysite.com but the URL keeps at fr.mysite.com. Clicking on a link then changes the URL correctly to en.mysite.com.
I'm aware that the following htaccess is wrong but I got no idea how it should be.
htaccess
RewriteCond %{HTTP_HOST} ^en.mysite.com$ [NC]
RewriteRule ^ http://fr.mysite.com/%{REQUEST_URI} [P]
Adding ?L=1 to the RewriteRule solves the problem on a first call and the URL ist correctly en.mysite.com but then on a second call like en.mysite.com/subsite realURL shows the postVar error.
the typoscript:
config {
sys_language_uid = 0
simulateStaticDocuments = 0
language = de
baseURL = http://fr.mysite.com/
}
[globalVar = GP:L = 1]||[globalVar = GP:L = en] || [globalString =
IENV:HTTP_HOST = en.mysite.com]
config {
sys_language_uid = 1
language = en
baseURL = http://en.mysite.com/
}
[global]
realurl_conf:
...
'preVars' =>
array (
0 => array(
'GETvar' => 'L',
'valueMap' => array(
'en' => '1'
),
'noMatch' => 'bypass'
)
),
...
Any help would be highly appreciated.