Apache Server configuration support - Multiple document root with one domain

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > January 2007 > Multiple document root with one domain





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Multiple document root with one domain
Eric Rosfelder

2007-01-10, 7:22 am

I have one domain and two documentroot :
- one for the content management system in ENGLISH
- one for the content management system in FRENCH

I would like to redirect to the good documentroot with a parameter in
the url.
Example :
http://www.domaine.com/index.php?wlang=en --> the documentroot of this
domain should be : /home/mysite_EN/www/

http://www.domaine.com/index.php?wlang=fr --> the documentroot of this
domain should be : /home/mysite_FR/www/

- How can I redirect to the good documentroot with a url parameter ?


- How can I set session variable in a htaccess or httpd.conf ? Because
I want to save the value au wlang parameter because, the wlang is not
always passed in the url. Beginning of response :

#This work, I can get $_SERVER['langchange'] in PHP
SetEnvIf Request_URI "/?wlang=fr" langchange=fr
SetEnvIf Request_URI "/?wlang=en" langchange=en


- How can I passed dynamic variable from .htaccess or httpd.conf to php
environment ?
I have a beggining of response in the htaccess but it doesn't really
work :
#This doesn't work, _SERVER["wlang"] %wlang
RewriteEngine on
RewriteRule ^(.*)/S=([^/]+)/?wlang=(.*) $1/$3 [E=wlang:$2]
SetEnv wlang %wlang




Thanks

Davide Bianchi

2007-01-10, 7:22 am

On 2007-01-10, Eric Rosfelder <eric.rosfelder@rbs.fr> wrote:
> I have one domain and two documentroot :
> - one for the content management system in ENGLISH
> - one for the content management system in FRENCH
>
> I would like to redirect to the good documentroot with a parameter in
> the url.
> http://www.domaine.com/index.php?wlang=en --> the documentroot of this
> domain should be : /home/mysite_EN/www/


PHP can already use multiple languages by reading the settings in the
client's browser, see the documentation of php about multilanguages,
more over, Apache already support multiviews where different html files
can be served depending on the languages.

I think both of these are better than having separated document root
(you get a default in case the language is something that you don't
manage).

Davide

--
Grown-up Operative System: old enough to drink, old enough to vote,
old enough to drive, old enough to fsck
- Brian Kantor and Anthony de Boer on asr
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com