title: TYPO3: How can I redirect to the translated homepage of a non translated page?
body: <p>I have created a multilanguage TYPO3 site with the following languages:</p>
  
  <ol>
  <li>german (default)</li>
  <li>english</li>
  <li>spanish</li>
  </ol>
  
  <p>There are no translations for all pages. For example I have ten pages in german and ten translated pages in english, but only four translated pages in spanish, but the language switcher is available on all sites. So if someone moves to one of the six pages which are not available in spanish and try to use the language switcher he will get the following error message:</p>
  
  <pre><code>Page Not Found
  Reason: Page is not available in the requested language (strict).
  </code></pre>
  
  <p>This isn't really nice and I think a better solution is to redirect the user to the spanish homepage if there is no spanish translation of a specific page, but how can I do something like this?</p>
  
  <p>My current language config looks like the following:</p>
  
  <pre><code>config {
      ...
      sys_language_uid = 0
      language = de
      htmlTag_langKey = de-DE
      locale_all = de_DE
      sys_language_mode = strict
  }
  
  [globalVar = GP:L = 1]
  config {
      sys_language_uid = 1
      language = en
      htmlTag_langKey = en
      locale_all = en_GB
      linkVars = L(1)
  }
  [global]
  
  [globalVar = GP:L = 2]
  config {
      sys_language_uid = 2
      language = es
      htmlTag_langKey = es
      locale_all = es
      linkVars = L(2)
  }
  [global]
  </code></pre>
  
  <p>And my language switcher looks like this:</p>
  
  <pre><code>obj.languageSwitcher = HMENU
  obj.languageSwitcher {
  
      special = language
      special.value = 0,1,2
      special.normalWhenNoLanguage = 0
  
      1 = TMENU
      1 {
          NO = 1
          NO {
              doNotLinkIt = 1
              stdWrap {
                  override = DE || EN || ES
                  typolink {
                      parameter.data = page:uid
                      additionalParams = &amp;L=0 || &amp;L=1 || &amp;L=2
                  }
                  outerWrap = &lt;li&gt;|&lt;/li&gt;
              }
          }
  
          ACT &lt; .NO
          ACT {
              stdWrap.typolink &gt;
              stdWrap.outerWrap = &lt;li class="active"&gt;|&lt;/li&gt;
          }
  
          USERDEF1 &lt; .NO
          USERDEF1 {
              stdWrap.typolink &gt;
          }
      }
   }
  </code></pre>
  
  <p>As you can see I currently have defined a USERDEF1 which removes the link from my language switcher if there is no spanish version of the current site, but I still want to redirect the user to the homepage of the spanish version. Do you have any suggestions?</p>