[TYPO3-english] Realurl, default language and 404 page

Pascal Cramer pascal at NOSPAMroguesheep.nl
Mon Feb 9 11:13:36 CET 2009


Hi people,

in a project on which I am currently working, we (me and the system admin) are 
having problems setting up Apache and/or TYPO3 redirects.

Background:
- TYPO3 4.2.5, WAMP, Apache/2.0.59 (Win32) PHP/5.2.6
- it concerns a multilingual site (single tree)
- the site should be visited on one domain
- serveral country-specific domains need to be redirected to the
   corresponding language preVar on the .com domain
- a lot of old url's form previous sites exist out there, the
   customer wants them all to be handled nicely, for this I set up
   fb_old2newredirect
- and, of course, Realurl is installed :-) Version 1.1.3 in the
   production installation and 1.5.3 in development.

We want to achieve the following:

1. when the site is requested without any language (i.e. 
http://www._domain_.com/), the default language prevar 'en' should be inserted 
in each url. (This to avoid duplicate content in Google and have the correct 
page ranking displayed for visitors.)
This is rather simple: just leave out the 'noMatch'=>'bypass' in the language 
prevar.

However, removing this statement causes Realurl to resolve invalid url's without 
any language prevar to the homepage.
For example http://www._domain_.com/en/non_existing_page.html is 'thrown' to the 
defined [FE][pageNotFound_handling] but 
http://www._domain_.com/non_existing_page.html wil result in the homepage being 
presented (with a http response code 200)

I have been through the Realurl manual and Google several times but perhaps I 
missed something or have I been searching for the wrong things?

2. Another thing are the redirects for the country-specific domains.
We would like to redirect only the 'bare' tld-requests to their corresponding 
language, for example http://www._domain_.nl/ should be redirected to 
http://www._domain_.com/nl/, any other requests on the .nl domain should be 
handled through [FE][pageNotFound_handling] (fb_old2newredirects)

Now we have defined a redirect for the virtual hosts:
-----
   Redirect permanent / http://www.aia-itp.com/
-----
But this will redirect all requests on this domain

I think this behaviour can also be achieved by using the Realurl 1.5.3 
'redirects' option but I cannot get it to work, ie nothing is being redirected
-----
     '_domain_.nl' => array(
       'redirects' => array('*' => 'nl/'),
     ),
-----

Can anybody shine a light in my darkness?

Thanks in advance,
Pascal

This is the realurl_conf.php for production:
-----
     '_DEFAULT' => array(
        'preVars' => array(
           '0' => array(
              'GETvar' => 'L',
              'valueMap' => array(
                 'en' => '0',
                 'de' => '1',
                 'nl' => '2',
                 'fr' => '3',
             ),

              'valueDefault' => 'en',
          ),

       ),

        'fileName' => array(
           'defaultToHTMLsuffixOnPrev' => '1',
       ),

        'pagePath' => array(
           'type' => 'user',
           'userFunc' => 
'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
           'spaceCharacter' => '-',
           'languageGetVar' => 'L',
           'autoUpdatePathCache' => 1,
           'expireDays' => '730',
           'rootpage_id' => '1',
       ),

        'fixedPostVars' => array(
       ),

    ),
-----


More information about the TYPO3-english mailing list