phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


Zend Framework Intro: Creating Apache .htaccess

Tag: framework, zend, zend framework, htaccess, mod_rewrite, apache   Category: PHP Framework
post: 08 Apr 2008 read: 2,043


Zend Framework Step By Step Tutorial - Part 4: We need route any requests to the front controller. We can use module from apache named "mod_rewrite". About this module, you can read at this post. Then, we will work with .htaccess file. This file will do routing job.

Create a file named ".htaccess" within web_root. Then enter following code:


RewriteEngine On
RewriteRule .* index.php

At the line 2, we can see, Apache will route all request to index.php. Simple code, isn't it?

Another option, you can configure it directly in Apache's httpd.conf file. We know, it is not easy way if we don't have own server. Thus, configure in a local Apache configuration file named .htaccess is better option.



Series this article:
Zend Framework Intro: Folder Structure
Zend Framework Intro: Explaining Anatomy of Zend Framework Application
Zend Framework Intro: Creating Index.php as Single Access File
Zend Framework Intro: Creating Apache .htaccess
Zend Framework Intro: Creating Controller
Zend Framework Intro: Creating View

| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Chart: How to Build Cool Animation Real Time Chart
Joomla: Fast Road to Understand Component Programming
Email: Send Attachement Mail
mod_rewrite - Part 1: create your "fantasy" URL

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


615
posting