RewriteEngine on # prevent httpd from serving dotfiles (.htaccess, .svn, .git, etc.) RedirectMatch 403 /\..*$ # RewriteBase is required in some hosting environments (Amazon EC2, ...) #RewriteBase / # if a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # prevent application 404 errors RewriteCond %{REQUEST_FILENAME} !robots\.txt RewriteCond %{REQUEST_FILENAME} !favicon\.ico # otherwise forward it to index.php RewriteRule . index.php