I have been inspecting some PHP source codes and I more often than not find files starting with
defined(\'__someconstant__\') or exit();
I
To avoid those (useless) lines at the top of (nearly) each file, your could:
Store a public "controller" file (like index.php in a directory called web or public on which your web server's alias or virtual host points to
Store in other directories like lib, config, apps... all the files that should not be directly accessed through the webserver by simply typing an URL.
This is typically the structure of existing frameworks such as Symfony 1.x
Additionally you can (and certainly will, for URL rewrites) put a .htaccess
file, but a server misconfiguration can incidentally disable it, so keeping source files in distinct directories is IMO better.