0

I'm trying to set environment variable(Apache/2.2.22) in my virtual host(not via .htaccess):

SetEnvIf Request_URI ^/path/to/something.php* EXTENSION=php

However, in php I see only $_SERVER['REDIRECT_REDIRECT_EXTENSION'], which is equal 'php' Why there is prefix REDIRECT_REDIRECT_? I expected to get it via $_SERVER['EXTENSION'].

However, when I set

 SetEnvIf Host test\.local RUN_CODE=test

It works properly, and I can get it via $_SERVER['RUN_CODE'].

Any advices?

sergio
  • 5,210
  • 7
  • 24
  • 46
  • http://stackoverflow.com/questions/3050444/when-setting-environment-variables-in-apache-rewriterule-directives-what-causes – Chetan Ameta Apr 11 '16 at 07:52
  • Make sure your PHP file handling the request is not the "prepend" file, else it may be triggered before that htaccess directive but outputs after. –  Apr 11 '16 at 07:54
  • @CharlSteynberg Look my last update of the comment. Thanks – sergio Apr 11 '16 at 08:03

0 Answers0