<?php
echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
// outputs example.com/news/file.php
?>
<?php
echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
// outputs example.com
?>
if(isset($_SERVER['REQUEST_URI'])){
$_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'], 0);
if(isset($_SERVER['QUERY_STRING']) AND $_SERVER['QUERY_STRING'] != "") {
$_SERVER['REQUEST_URI'] .= '?' .$_SERVER['QUERY_STRING'];
}
}
I have the same problem with Apache 2, but I solved the same way. (ver. 4.0.2)