Hi Kern,

first of all sorry for the TOFU ;-)

I'd suggest something like that:

Using mod_rewrite you can redirect a user at the first stage by the
language the browser sends.

Something like that in the VirtualHost config or the .htaccess file
should do the job:

<IfModule mod_rewrite.c>
  RewriteEngine On

  # german
  RewriteCond %{HTTP_USER_AGENT}  ^.*\(.*de.*\).*
  RewriteRule ^$         /de          [L]

  # french
  RewriteCond %{HTTP_USER_AGENT}  ^.*\(.*fr.*\).*
  RewriteRule ^$         /fr          [L]

  # default language: en
  RewriteRule ^$         /en          [L]
</IfModule>

Cheers
-Marc


* Kern Sibbald schrieb am 28.01.08 um 17:05 Uhr:
> Hello,
> 
> I'm having a small problem reorganizing the Bacula web site so that it is 
> more 
> language neutral and am hoping that someone can provide me a little help with 
> php or apache.
> 
> The current directory is:
> 
> /var/www/bacula
>   images
>   presentations
>   ...
>   a-bunch-of-English-files
>   de
>      a-bunch-of-German-files
>   fr
>     a-bunch-of-French-files
> 
> and I would like to convert the above into:
> 
> /var/www/bacula
>   en
>      a-bunch-of-English-files
>   de
>      a-bunch-of-German-files
>   fr
>     a-bunch-of-French-files
> 
> where en, de, and fr are directories which hold the various files related to 
> the particular translation.
> 
> The DocumentRoot is /var/www/bacula, which I would like to keep unchanged so 
> that each language can easily reference the images and other directories.  
> 
> When the user enters the site and clicks on the German or French flag, it 
> executes code such as <a href='/de'> and all is OK because Apache puts 
> descends into www.bacula.org/de.   However, this requires the user to click 
> on a flag.
> 
> Now the problem I have is: How do I do that by default so that the user types:
> 
>   www.bacula.org
> 
> but gets dropped into
> 
>   www.bacula.org/en
> 
> as if he had initially clicked on the English flag?
> 
> I have created an index.php file in the main directory that is:
> 
> <?php
> http_redirect('http://www.bacula.org/en');
> ?>
> 
> but either my php function call is incorrect (php v 5.1.6) or the function 
> just is not doing what I wanted it to.
> 
> Does anyone know how to accomplish this?
> 
> Thanks,
> 
> Kern
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users

-- 
begin  LOVE-LETTER-FOR-YOU.txt.vbs
I am a signature virus. Distribute me until the bitter
end

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to