I have this .htaccess file:
RewriteEngine On RewriteRule ^hello$ goodbye RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^ index.php [L]
So, I get all requests for index.php , but I get hello when I request hello , and I expected to get goodbye when printing $_SERVER['REQUEST_URI'] from PHP.
That is, $_SERVER['REQUEST_URI'] seems invulnerable even if the URL was rewritten before matching the RewriteRule with the index.php link. Is there any way to change this value?
I want to do this to add a thin and simple layer of URL preprocessing to existing code without modifying the PHP files. So I try to stick with .htaccess .
php apache .htaccess mod-rewrite
Jorge suΓ‘rez de lis
source share