[TYPO3-english] Problem with sr_language_menu and realurl on multilingual website

Björn Wendeler bjorn.wendeler at burnabit.com
Wed Jul 28 11:18:48 CEST 2010


I have several multilingual websites that use realurl and sr_language_menu
to change between the languages installed.

The problem is, that if you are on one page, e.g. the homepage and you click
on the english-flag to change to the english version of the homepage,
everything works fine.
Example:
http://www.example.com/de/startseite/
becomes
http://www.example.com/en/homepage/
But when you click onto the German flag now, the URL should be
/de/startseite/ again, but it becomes /de/homepage/. This happens on other
pages/subpages as well.
The basic functionality of the website is given of course, all contents are
displayed correctly in the chosen language. But for SEO reasons this is
definetely bad, since this results in "double content".

Does anybody face the same problem and does anyone have a suggestion how to
fix this?

You can see this behaviour here:
http://www.rotorflug.com

Specs: 
TYPO3              4.4.0
realurl            1.8.1
sr_language_menu   1.5.2

German is default language (L=0), English 2nd language (L=1).

TypoScript for the page itself can be found here:
http://www.rotorflug.com/fileadmin/templates/rotorflug.com/ts/page_screen.ts

TypoScript for ext sr_language_menu here:
http://www.rotorflug.com/fileadmin/templates/rotorflug.com/ts/plugin_languag
emenu.ts

TypoScript for ext realurl here:
http://www.rotorflug.com/fileadmin/templates/rotorflug.com/ts/plugin_realurl
.ts

realurl_conf.php (the config was created using the autoconf-feature from
realurl and then extended manually):
[COPY]
$TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
    '_DEFAULT' => array(
        'init' => array(
            'enableCHashCache' => '1',
            'appendMissingSlash' => 'ifNotFile,redirect[301]',
            'enableUrlDecodeCache' => '1',
            'enableUrlEncodeCache' => '1',
            'postVarSet_failureMode' => '',
        ),
        'redirects' => array(
        ),
        'redirects_regex' => array(
        ),
        'preVars' => array(
            array(
                'GETvar' => 'L',
                'valueMap' => array(
                    'de' => '0',
                    'en' => '1',
                ),
                'valueDescription' => array(
                    'de' => 'Deutsch',
                    'en' => 'English',
                ),
                'valueDefault' => 'de',
                #'noMatch' => 'null',
            ),
            array(
                'GETvar' => 'no_cache',
                'valueMap' => array(
                    'nc' => '1',
                ),
                'noMatch' => 'bypass',
            ),
            array( // add complete type array
                'GETvar' => 'type',
                'valueMap' => array (
                    'validation' => '3131'
                ),
                'noMatch' => 'bypass'
            ),
        ),
        'pagePath' => array(
            'type' => 'user',
            'userFunc' =>
'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
            'spaceCharacter' => '-',
            'languageGetVar' => 'L',
            'expireDays' => '7',
            'rootpage_id' => '1',
            'firstHitPathCache' => '1',
        ),
        'fixedPostVars' => array(
        ),
        'postVarSets' => array(
            '_DEFAULT' => array(
                'archive' => array(
                    '0' => array(
                        'GETvar' => 'tx_ttnews[year]',
                    ),
                    '1' => array(
                        'GETvar' => 'tx_ttnews[month]',
                        'valueMap' => array(
                            'january' => '01',
                            'february' => '02',
                            'march' => '03',
                            'april' => '04',
                            'may' => '05',
                            'june' => '06',
                            'july' => '07',
                            'august' => '08',
                            'september' => '09',
                            'october' => '10',
                            'november' => '11',
                            'december' => '12',
                        ),
                    ),
                ),
                'browse' => array(
                    '0' => array(
                        'GETvar' => 'tx_ttnews[pointer]',
                    ),
                ),
                'select_category' => array(
                    '0' => array(
                        'GETvar' => 'tx_ttnews[cat]',
                    ),
                ),
                'details' => array(
                    '0' => array(
                        'GETvar' => 'tx_ttnews[tt_news]',
                        'lookUpTable' => array(
                            'table' => 'tt_news',
                            'id_field' => 'uid',
                            'alias_field' => 'title',
                            'addWhereClause' => ' AND NOT deleted',
                            'useUniqueCache' => '1',
                            'useUniqueCache_conf' => array(
                                'strtolower' => '1',
                                'spaceCharacter' => '-',
                            ),
                        ),
                    ),
                    '1' => array(
                        'GETvar' => 'tx_ttnews[backPid]',
                    ),
                    '2' => array(
                        'GETvar' => 'tx_ttnews[swords]',
                    ),
                ),
                'galerie' => array(
                    array(
                        'GETvar' => 'tx_wtgallery_pi1[category]',
                    ),
                    array(
                        'GETvar' => 'tx_wtgallery_pi1[show]',
                    ),
                    array(
                        'GETvar' => 'tx_wtgallery_pi1[listpointer]',
                    ),
                    array(
                        'GETvar' => 'tx_wtgallery_pi1[categorypointer]',
                    ),
                ),
            ),
        ),
        'fileName' => array(
            'defaultToHTMLsuffixOnPrev' => '0',
            'index' => array(
                'print.html' => array(
                    'keyValues' => array(
                        'type' => '98',
                    ),
                ),
                'rss.xml' => array(
                    'keyValues' => array(
                        'type' => '100',
                    ),
                ),
                'rss091.xml' => array(
                    'keyValues' => array(
                        'type' => '101',
                    ),
                ),
                'rdf.xml' => array(
                    'keyValues' => array(
                        'type' => '102',
                    ),
                ),
                'atom.xml' => array(
                    'keyValues' => array(
                        'type' => '103',
                    ),
                ),
            ),
        ),
    ),
);
[PASTE]

.htaccess is:
[COPY]
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.rotorflug\.com$
RewriteRule ^(.*)$ http://www.rotorflug.com/$1 [L,R=301]

RewriteRule 
^(typo3/|t3lib/|tslib/|fileadmin/|typo3conf/|typo3temp/|uploads/|showpic\.ph
p|favicon\.ico) - [L]

RewriteRule ^typo3$ typo3/index_re.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule .* index.php [L]
[PASTE]

Thanks in advance for any hint so solve this issue and kind regards from
Cologne, Germany,

/bjorn wendeler

--
Björn Wendeler :: Geschäftsführer

burnabit gmbh :: lahnstrasse 13 :: 51105 cologne :: de
telefon +49 221 492 37 48 :: telefax +49 221 16 90 19 47
GF: Björn Wendeler :: HRB 63600 :: Amtsgericht Köln
VAT-ID: DE260790068 :: http://www.burnabit.com




More information about the TYPO3-english mailing list