.htaccess with environment variables

software development



I’m trying to use url rewriting in one of our sites.

The way we use it on local copy of the site is to use a rewrite rule filling
an environment variable that will be read by a PHP script in order to seek
into the MySQL database.


RewriteRule ^(.*/)?[^/.]+/?$ spip.php?page=rubrique [QSA,E=url_propre:$0,L]


echo “spip:REDIRECT_url_propre=” . $_SERVER[‘REDIRECT_url_propre’];

I tried to look for $_SERVER[‘url_propre’], $_SERVER[‘REDIRECT_url_propre’], $_SERVER[‘REDIRECT_SCRIPT_URL’],
$_SERVER[‘SCRIPT_URL’] and $GLOBALS[‘HTTP_ENV_VARS’][‘url_propre’] without success. They all are empty.

Everything is correct on our local Wampserver and is coming strictly from the
SPIP community, without any change from myself, but fail on Dreamhost : I get
nothing in the environment variable.

Would you please indicate me if Dreamhost offer a way to deal with that kind
of rewrite rule and if yes, could you provide me an example?

I searched in the whole forum past posts and found only one reference about these environment variables.

The wiki pages do not mention them:

Could any one may give some advice about this stuff?

Thank you,.

Vincent François