views:

992

answers:

3

I know I've seen this done before but I can't find the information anywhere. I need to be able to route with .html extensions in the Zend Framework.

I.E. /controller/action.html should route to the appropriate controller / action.

We have an idea to throw away the .html extension with our .htaccess file but I think changing the route config would be the better solution.

Any advice is welcome.

A: 

The default route (without modules) is

:controller/:action

which you can remove by

$router->removeDefaultRoutes();

Then add your version:

:controller/:action.html
Karsten
That doesn't work. The parameter name becomes action.html instead of action.
smack0007
+1  A: 

A quick search on google yielded the following tutorials:

Extending Zend Framework Route and Router for custom routing
Routing and complex URLs in Zend Framework

Noah Goodrich
The second result is the tutorial I remember reading, so I'll give you the answer.
smack0007
CodeUtopia happens to be one of the blogs that I follow regularly.
Noah Goodrich
A: 

i want whole process and code of ini and bootsrtap with an example

rakesh
we don't **give** code here, we answer questions.
Natrium
Follow the links that were provided by the accepted answer.
smack0007