I have a little problem with .htaccess: With this code,
SetEnvIfNoCase Request_URI ^(.*)$ TEST=$1
TEST will give me /index.php even when my URL (which is rewritten) is something else.
For example:
// URL: http://www.example.com/us_en/module/controller/
echo $_SERVER['TEST']; // returns /index.php
echo $_SERVER["REQUEST_URI"]; // returns /us_en/module/controller/
I would like TEST to have the full path in REQUEST_URI from .htaccess and not just /index.php.
I know this might be caused by something in the rewrite conditions so I’ll show you what I have:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^api/rest api.php?type=rest [QSA,L]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
RewriteRule .* - [L,R=405]
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php [L]
Try one of these:
These are Environment Variables.
They also should be available in PHP’s
$_SERVERsuperglobal.