Answer the question
In order to leave comments, you need to log in
I change the path through htaccess, but PHP still knows the original path. Why?
Hello! To shorten the url, I shorten it with htaccess:
RewriteRule ^([A-z0-9]{3,20})/archive/$ /pages/$1/files/archive/ [QSA]
<?
print_r($GLOBALS);
?>
Answer the question
In order to leave comments, you need to log in
It's impossible to do so.
You can see the requested (short) path in $_SERVER['REQUEST_URI']
, but the actual location from which the script was launched $_SERVER['DOCUMENT_ROOT']
$_SERVER['SCRIPT_FILENAME']
$_SERVER['SCRIPT_NAME']
cannot be changed, since these values are determined at the time of launch.
Although you can try one "feint with your ears" this is an indication auto_prepend_file
in .htaccess
you make a script prepend.php
that will be automatically loaded when you run any script and overwrite whatever you want in it.
php_value auto_prepend_file /www/server/prepend.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question