[Nottingham] Apache / mod_rewrite / php and environment variables

David Aldred david at familyaldred.org.uk
Sun Dec 17 22:50:23 GMT 2006


Just to add a note: I've found a workaround:

RewriteEngine On
RewriteRule   w/S=([^/]+)/(.*)    w/$2?STATUS=$1 [QSA]

..where QSA means the original query string (if any) is appended properly to 
the new address - so
	http://aldred.org/test/w/S=mysite/index.php?x=123
becomes
	http://aldred.org/test/w/index.php?STATUS=mysite&x=123
and I can then read STATUS from the $_GET superglobal. 

If anyone knows why the original system didn't work, though, I'd be grateful - 
it looked a somehow 'cleaner' solution to what I want to do!

-- 
David Aldred



More information about the Nottingham mailing list