[Nottingham] Apache / mod_rewrite / php and environment variables

Andy Davidson andy at nosignal.org
Sun Dec 17 19:58:33 GMT 2006


On 17 Dec 2006, at 17:58, David Aldred wrote:

>> The rewrite rule makes it look like the url should be http:// 
>> aldred.org/w/.... - the ^ here means "immediately at the start",  
>> so the url with 'test' in it would be enough to prevent the  
>> rewrite rule matching.
> But the rewrite is at least partially working - the file serving  
> the request is at aldred.org/test/w/index.php - so the match does  
> seem to be being made. You can see this from the output -  
> SCRIPT_FILENAME is set to this file. The .htaccess is in the  
> directory 'test' - as I understand it, the ^ in this case would  
> mean 'starting from where it hits this directory'.

Sorry, David, I'd quoted, but missed the '.htaccess is in the 'test'  
directory' comment.

I've had a look at a bunch of rewrites I maintain, and it uses  
E=VARIABLE:contents, rather than 'env'.  Is that it ?

Additionally, as a safety feature, I think environment variables come  
passed through as REDIRECT_VARIABLE by the time apache dishes them  
out to you (it does with cgi anyway)






-- 
Regards, Andy Davidson
Consultant Systems and Network Engineer, Devonshire IT Limited
http://www.devonshire.it/  -  0844 704 704 7  - Sheffield, UK





More information about the Nottingham mailing list