Share on Google+Share on Google+

Zend FrameWork Part-3

In this tutorial we will study about Zend Framwork of PHP, Bootstrapping and different settings of .htaccess files are discussed in this topic. This is the third episode of the series subsequent pages will discuss on other and advance topic.

Zend Framework (Part-3):


Zend_Controller which is a Zend Framework's controller is built to support websites with clean URLs. To achieve clean URLs all requests should go through a single file called index.php( bootstrapper). This is like a central point for all pages of the application. All we have to do is create a file htaccess in the root directory (NewProject) and write the following code as follows:

 RewriteEngine on

RewriteRule .* index.php

php_flag magic_quotes_gpc off

php_flag register_globals off

The RewriteRule is simple and it is necessary for security reason. We also set a couple of PHP ini settings for security and sanity purpose. Requests for any script file like JavaScript etc., images, CSS files should not be accessible from the bootstrapper. To do this put all files under public subdirectory and configure Apache to serve these files directly with another .htaccess file in NewProject/public folder and write the following code in this file:

RewriteEngine off

To ensure that our application and library directories are protected, add the following folders and add contents in the file:


deny from all


deny from all


Note: .htaccess files are used by Apache, the configuration directive AllowOverride

must be set to All within your httpd.conf file.



Posted on: April 8, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.


Advertisement null