Development - File Structure for standard application

Below the File Structure for standard application:

protected/.htaccess - htaccess file denies access to protected directory from all
deny from all

templates/.htaccess - htaccess file denies access to all PHP files in templates directory
<FILES ~ "\.php$">
Order allow,deny  
Deny from all  

.htaccess - htaccess file converts all requests into url parameter and perform following directives
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

# Rewrite all other URLs to index.php/URL
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

# Recommended directive to disable directory browsing
Options All -Indexes

index.php - main HTTP request dispatcher file
// Change the following paths if necessary
defined('APPHP_PATH') || define('APPHP_PATH', dirname(__FILE__));
// Directory separator
defined('DS') || define('DS', DIRECTORY_SEPARATOR);
// Production | debug | demo | test | hidden
defined('APPHP_MODE') or define('APPHP_MODE', 'debug'); 

$apphp = dirname(__FILE__).'/../../framework/Apphp.php';
$config = APPHP_PATH.'/protected/config/';