views:

95

answers:

3

I am using Zend Framework and want to be able to end my URLs in ".htm". What should I add to my .htaccess file?

So the following would be equivilent:

www.mysite.com/controller
www.mysite.com/controller.htm

As would:

www.mysite.com/controller/action
www.mysite.com/controller/action.htm

Nothing I have tried seems to work.

A: 

You could use this rule to remove the .htm ending:

RewriteRule (.+)\.htm$ $1
Gumbo
+1  A: 

What you're searching for is mod_rewrite. Try something like:

RewriteEngine On
RewriteRule (.+)\.htm$ $1

Best wishes,
Fabian

halfdan
A: 

I actually solved this with Zend_Controller_Router_Route_Regex - it lets me apply regex before the request is routed to any particular controller. Nice because I can then keep my default ZF .htaccess file and not have my logic spread about too much.

voidstate