Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 33037 invoked from network); 9 Feb 2007 13:36:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Feb 2007 13:36:19 -0000 Received: (qmail 37603 invoked by uid 500); 9 Feb 2007 13:36:14 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 37585 invoked by uid 500); 9 Feb 2007 13:36:14 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 37574 invoked by uid 99); 9 Feb 2007 13:36:14 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Feb 2007 05:36:14 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [193.41.214.50] (HELO smtp.quicknet.se) (193.41.214.50) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Feb 2007 05:36:03 -0800 Received: from [217.78.20.24] (helo=[192.169.11.116]) by smtp.quicknet.se with esmtp id 1HFVuS-0005fa-Nn for ; Fri, 09 Feb 2007 14:35:28 +0100 Mime-Version: 1.0 (Apple Message framework v752.2) To: users@httpd.apache.org Message-Id: <0F702744-10F4-4C90-B119-2DAA2727D48F@nikehydraulics.se> Content-Type: multipart/alternative; boundary=Apple-Mail-16--552598165 From: Frank Arensmeier Date: Fri, 9 Feb 2007 14:35:30 +0100 X-Mailer: Apple Mail (2.752.2) X-Virus-Checked: Checked by ClamAV on apache.org Subject: [users@httpd] Help with mod_rewrite --Apple-Mail-16--552598165 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Hello. I apologize if this has been asked before. Based on the requested url, I am trying to map those urls to my file system. I have come up with the following Rewrite rule (in my htaccess file)so far: RewriteRule ^(se|en|us)/(.+) /$2 [E=LANG_CODE:$1] As you can see, my site is been translated into english, american english and swedish. Based on the env variable ['REDIRECT_LANG_CODE], I include either English, Swedish or whatever language it might be in the html output. A request for e.g.: http://myserver.com/en/about/history.php will be remapped to the file "histrory.php" in the folder "about". This is actually working as I thought I would be. The problem is when a user requests a URL like: http://myserver.com/en/about Apparently, Apache does an internal redirect because it is looking for the index.php file (which exists) in the folder "about". The thing I do not understand is why the user is being redirected to http://myserver.com/about??? When doing so, the environmental variable LANG_CODE is lost. Why? How can I map those requests to my index file without redirecting the user? Am I making sense? //frank --Apple-Mail-16--552598165 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1
Hello.
I=A0apologize = if this has been asked before. Based on the requested url, I = am=A0trying=A0to map those urls to my file system. I have come up with = the following Rewrite rule (in my htaccess file)so far:

RewriteRule = ^(se|en|us)/(.+) /$2 [E=3DLANG_CODE:$1]

As you can see, my site is = been translated into english, american english and swedish. Based on the = env variable ['REDIRECT_LANG_CODE], I include either English, Swedish = or=A0whatever=A0language it might be in the html output. A request for = e.g.:

http://myserver.com/en/a= bout/history.php will be remapped to the file "histrory.php" in the = folder "about". This is=A0actually working as I thought I would be. The = problem is when a user requests a URL like:

http://myserver.com/en/about

Apparently,=A0Apac= he does an internal=A0redirect because it is looking for the index.php = file (which exists) in the folder "about". The thing I do not understand = is why the user is being redirected to http://myserver.com/about??? = When doing so, the=A0environmental variable LANG_CODE is lost. Why? How = can I map those requests to my index file without redirecting the = user?

Am I = making sense?

//frank

=
= --Apple-Mail-16--552598165--