You can put your index.php in your web directory. And put all the files that it includes in another non-web directory.
Say you are at http://www.example.com/index.php actually /path/to/your/home/www/index.php, you can put contact.php in /path/to/your/home/includes/contact.php. No .htaccess, rewrite, auto add. Just a good file structure and server configured as needed.
Edit the detailed comment for using xamp:
In your httpd.conf file, add something like this:
<Directory "/path/to/your/site/root">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
<VirtualHost *:80>
DocumentRoot /path/to/your/site/root
ServerName www.example.org
</VirtualHost>
Then in your Windows hosts file (in C: \ Windows \ System32 \ drivers \ etc) add this line:
127.0.0.1 www.example.com
Arkh source
share