[Nottingham] Apache / mod_rewrite / php and environment variables

David Aldred david at familyaldred.org.uk
Sun Dec 17 22:34:18 GMT 2006


On Sunday 17 December 2006 19:58, Andy Davidson wrote:
> 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.

That's OK - this stuff can get a bit dense!
>
> I've had a look at a bunch of rewrites I maintain, and it uses
> E=VARIABLE:contents, rather than 'env'.  Is that it ?
>

The documetnation indicates that they are equivalent.   I've tried both, just 
in case, but no improvement!

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

Hmmm.  Asking PHP to print_r($_REQUEST_VARIABLE) doesn't do any good, and 
there's no $_(whatever)['REQUEST_VARIABLE'] that I can see.

Aaargh.   This really should work!

-- 
David Aldred



More information about the Nottingham mailing list