Edit your hosts file and change localhost to "1" or as you like you will be able to access root directory files as 1/file.php.Do the following steps
My Computer > C: (or whatever drive Windows is on) > WINDOWS > system32 > drivers > etc > hosts
Note: If you aren't sure where My Computer is or you just want to use a keyboard shortcut to open it, you can hold down the Windows key on your keyboard while you press the āEā key.
Right-click on the HOSTS file, and click Open. A window will appear asking what to open it with; find Notepad, select it, and click OK.
If you've never edited your HOSTS file before, this is what it should look like:
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
change localhost to 1
you will be able to access the file using http://1/file.php