Hallo Forum,
bekomme einfach die Mehrsprachigkeit mit RealURL nicht hin.
Wo ist hier der Wurm?
Zur Info: Die Uebersetzungen der Sprachen sind vorhanden und erreichbar ueber
/index.php?id=2&L=0
/index.php?id=2&L=1
/index.php?id=2&L=2
/index.php?id=2&L=3
/index.php?id=2&L=4
Das TypoScript im root Template:
config.baseURL = http://www.meineDomain.com/
config.simulateStaticDocuments = 0
config.tx_realurl_enable = 1
# GET-Parameter für Sprache
config.linkVars = L
# SPRACHWAHL
# **********************
# en = HAUPTSPRACHE
config (
sys_language_uid = 0
language = en
locale_all = en_US.UTF-8
)
# Portuguese language, sys_language.uid = 1
[globalVar = GP:L = 1]
config.sys_language_uid = 1
page.config.language = pt
page.config.locale_all = pt_PT.UTF-8
[global]
# Deutsch language, sys_language.uid = 2
[globalVar = GP:L = 2]
config.sys_language_uid = 2
page.config.language = de
page.config.locale_all = de_DE.UTF-8
[global]
# Spanish language, sys_language.uid = 3
[globalVar = GP:L = 3]
config.sys_language_uid = 3
page.config.language = es
page.config.locale_all = es_ES.UTF-8
[global]
# French language, sys_language.uid = 4
[globalVar = GP:L = 4]
config.sys_language_uid = 4
page.config.language = fr
page.config.locale_all = fr_FR.UTF-8
[global]
page.10.marks.SPRACHE < tmp.SPRACHE
Die localconf.php:
$TYPO3_CONF_VARS['EXT']['addRootLineFields'].= ',tx_realurl_pathsegment';
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array (
'_DEFAULT' =>
array (
'preVars' =>
array (
'GETvar' => 'L',
'valueMap' => array(
'en' => '0',
'pt' => '1',
'de' => '2',
'es' => '3',
'fr' => '4',
),
'valueDefault' => 'en',
# 'noMatch' => 'bypass',
),
'init' =>
array (
'enableCHashCache' => true,
'appendMissingSlash' => 'ifNotFile,redirect',
'adminJumpToBackend' => true,
'enableUrlDecodeCache' => true,
'enableUrlEncodeCache' => true,
'emptyUrlReturnValue' => '/T3/',
),
'pagePath' =>
array (
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
),
'fileName' =>
array (
'defaultToHTMLsuffixOnPrev' => 1,
'acceptHTMLsuffix' => 1,
'index' =>
array (
'print' =>
array (
'keyValues' =>
array (
'type' => 98,
),
),
),
),
),
);
Und das Template fuer die Auswahl der Sprache:
tmp.SPRACHE = COA
tmp.SPRACHE{
wrap = |
10 = TEXT
10 {
field = uid
dataWrap = <a href="index.php?id=|&L=0" class="language">GB</a>
}
20 = TEXT
20 {
field = uid
dataWrap = <a href="index.php?id=|&L=1" class="language">PT</a>
}
30 = TEXT
30 {
field = uid
dataWrap = <a href="index.php?id=|&L=2" class="language">DE</a>
}
40 = TEXT
40 {
field = uid
dataWrap = <a href="index.php?id=|&L=3" class="language">ES</a>
}
50 = TEXT
50 {
field = uid
dataWrap = <a href="index.php?id=|&L=4" class="language">FR</a>
}
}
Und die .htaccess:
### Begin: Browser caching of ressource files ###
# Enable long browser caching for JavaScript and CSS files.
# This affects Frontend and Backend and increases performance.
# You can also add other file extensions (like gif, png, jpg), if you want them to be longer cached, too.
<FilesMatch "\.(js|css)$">
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 7 days"
</IfModule>
FileETag MTime Size
</FilesMatch>
<IfModule mod_rewrite.c>
# Enable URL rewriting
RewriteEngine On
# Change this path, if your TYPO3 installation is located in a subdirectory of the website root.
RewriteBase /
# Rule for versioned static files, configured through:
# - $TYPO3_CONF_VARS['BE']['versionNumberInFilename']
# - $TYPO3_CONF_VARS['FE']['versionNumberInFilename']
# IMPORTANT: This rule has to be the very first RewriteCond in order to work!
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]
# Stop rewrite processing, if we are in the typo3/ directory.
# For httpd.conf, use this line instead of the next one:
# RewriteRule ^/TYPO3root/(typo3/|t3lib/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
RewriteRule ^(typo3/|t3lib/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
# Redirect http://example.com/typo3 to http://example.com/typo3/index_re.php and stop the rewrite processing.
# For httpd.conf, use this line instead of the next one:
# RewriteRule ^/TYPO3root/typo3$ /TYPO3root/typo3/index.php [L]
RewriteRule ^typo3$ typo3/index_re.php [L]
# If the file/symlink/directory does not exist => Redirect to index.php.
# For httpd.conf, you need to prefix each '%{REQUEST_FILENAME}' with '%{DOCUMENT_ROOT}'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
# Main URL rewriting.
# For httpd.conf, use this line instead of the next one:
# RewriteRule .* /TYPO3root/index.php [L]
RewriteRule .* index.php [L]
</IfModule>
RewriteCond %{HTTP_HOST} ^meineDomain.com$ [NC]
RewriteRule ^(.*)$ http://www.meineDomain.com/$1 [R=301,L]