<?php echo "<pre>"; $info = apache_lookup_uri('index.php?var=value'); print_r($info); if (file_exists($info->filename)) { echo 'file exists!'; } ?> output:- stdClass Object ( [status] => 200 [the_request] => GET /php/s/1 HTTP/1.1 [method] => GET [mtime] => 0 [clength] => 0 [chunked] => 0 [content_type] => text/html [handler] => application/x-httpd-php [no_cache] => 0 [no_local_copy] => 1 [unparsed_uri] => /php/s/index.php?var=value [uri] => /php/s/index.php [filename] => C:/xampp/htdocs/php/s/index.php [args] => var=value [allowed] => 0 [sent_bodyct] => 0 [bytes_sent] => 0 [request_time] => 1513669009 ) file exists!