Hello Dan,
On Monday 28 January 2008 17.12:59 Dan Langille wrote:
> Kern Sibbald wrote:
> > 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
>
> I do that in the configuration files to redirect people from
> freshports.org to www.freshports.org, but that's probably not quite what
> you want, but I will show it anyway:
>
>
> <VirtualHost *>
> ServerAdmin [EMAIL PROTECTED]
> ServerName freshports.org
>
> Redirect permanent / http://www.freshports.org/
>
> ErrorLog /usr/websites/log/freshports.org-error.log
> CustomLog /usr/websites/log/freshports.org-access.log combined
> </VirtualHost>
Hmm. When I tried the above, I was of course redirecting it on itself, so it
went into a recursive loop, which after a bit of reflection is to be
expected ...
>
>
> What I think you want is this:
>
> <?php
> header("Location: /en/"); /* Redirect browser */
> ?>
Once I deleted some extraneous stuff before the header, it worked
perfectly!!!!
Even though the default is English, we now have a language "neutral" web site
rather than an English one with other languages tacked on :-)
Many 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users