Re: mod_rewrite and setenv

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks very much for the fast responses. Can this info be added in the mod_rewrite documentation, as this is very important for future questions?
 
OR: can the order of processing be changed?

--- On Sun, 11/1/09, Rich Bowen <rbowen@xxxxxxxxxxx> wrote:

From: Rich Bowen <rbowen@xxxxxxxxxxx>
Subject: Re: mod_rewrite and setenv
To: users@xxxxxxxxxxxxxxxx
Date: Sunday, November 1, 2009, 7:17 PM


On Nov 1, 2009, at 10:50 , Andrei Iarus wrote:

Hello,
 
I have looked a lot in Internet, and found many people complaining about the same problem, with no normal answer.
 
My problem:
mod_rewrite with its RewriteCond %{ENV:variable} form cannot read correctly the environment variables.
 
The variable is set directly in the .htaccess OR in the main httpd.conf. No matter, the variable won't be read. THe logging of the rewrite process will show that the value of %{ENV:variable} will be "".
 
I have found the same problem posted 5 years ago, with no answer, which is awkward (if this is a bug).
 
What I wrote was:
 
SetEnv APPLICATION_ENV development
 
RewriteCond %{ENV:APPLICATION_ENV} ^development$
RewriteRule ^.*$ /XXX/index.php [NC,L]
 
Unfortunately, it doesnt work. Any experience with that? Where should I complain further?



This is a matter of order of processing. The rewrite directives run earlier than the SetEnv directives. You can set the env var with mod_rewrite:

RewriteRule ^ - [E:APPLICATION_ENV=development]

--
Rich Bowen





[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux