[Nottingham] Apache / mod_rewrite / php and environment variables

Andy Davidson andy at nosignal.org
Sun Dec 17 17:42:08 GMT 2006


On 17 Dec 2006, at 16:22, David Aldred wrote:

> .htaccess in directory 'test' contains:
> 	RewriteEngine On
> 	RewriteRule ^w/S=([^/]+)/(.*) w/$2 [env=STATUS:$1]
> ..which should take http://aldred.org/test/w/S=mysite/index.php and  
> convert it
> to http:/aldred.org/test/w/index.php, with the environment variable  
> 'STATUS'
> set to 'mysite'.

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.




-- 
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