简体   繁体   English

多个子域重定向到TYPO3和RealUrl

[英]Multiple Subdomain redirect to TYPO3 and RealUrl

I have TYPO3 7.6.18 installed with realURL and two languages (en,fr) on a single tree. 我在一棵树上安装了带有realURL和两种语言(en,fr)的TYPO3 7.6.18。 the installation is on subdomain fr.mysite.com with bot domains added to the root page. 安装是在子域fr.mysite.com上,并将bot域添加到根页面。 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. 首次调用en.mysite.com时,我需要重定向到fr.mysite.com,但URL保持在fr.mysite.com。 Clicking on a link then changes the URL correctly to en.mysite.com. 单击链接,然后将URL正确更改为en.mysite.com。

I'm aware that the following htaccess is wrong but I got no idea how it should be. 我知道以下htaccess是错误的,但我不知道应该怎么做。

htaccess 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. 在RewriteRule中添加?L = 1可以解决第一个调用的问题,并且URL正确访问了en.mysite.com,但随后在第二个调用(如en.mysite.com/subsite realURL)显示postVar错误。

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: realurl_conf:

...
'preVars' =>
    array (
        0 => array(
            'GETvar' => 'L',
            'valueMap' => array(
                'en' => '1'
            ),
            'noMatch' => 'bypass'
        )
    ),
...

Any help would be highly appreciated. 任何帮助将不胜感激。

I don't think that changes in the default .htaccess are required but both domains are handled by TYPO3 and realurl. 我认为不需要更改默认的.htaccess ,但两个域都由TYPO3和realurl处理。
In realurl you've to make a setup for both domains and adjust the required parameters on base of a default configuration. 在realurl中,您必须为两个域都进行设置,并根据默认配置调整所需的参数。
In Backend you've to create the required language-records beside the setup which you posted. 在后端中,您必须在发布的设置旁边创建所需的语言记录。
Your Setup has a fault, for fr it should be like this: 您的安装程序有故障,因为它应该是这样的:

config {
  sys_language_uid = 0
  simulateStaticDocuments = 0
  language = fr
  baseURL = http://fr.mysite.com/
}

EDIT: Above I assume that both domains are handled by the same TYPO3 installation. 编辑:上面我假设两个域都由相同的TYPO3安装处理。 That's possible and in general a good solution. 这是可能的,并且通常是一个好的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM