I’ve been doing quite a bit of research for the last few weeks about the Zend Framework and the integration with Adobe Flex in preparation for the release of Zen_AMF_Server module. A recurring issue that came up is that Zend’s framework uses the Apache mod_rewrite module to redirect the paths to the appropriate directories. I’m using .htaccess files for the rewrite rules. On important detail is that .htaccess rules are for the directory in which they reside- whereas the httpd.conf is a set of server-wide rules.
That’s fine except that now my requests for swf and flv files get redirected.
The first solution that I came across was here. It involves adding swf and .flv suffixes in the rewrite rule. This realization was important because it was the first time that I became truly aware of the rules and their implementation details.
Another solution used in Flex and PHP Party in the Front Business in the Back is to put the swf files in a “flash” folder and place a custom .htaccess file in there. Not sure what the pros and cons of that are yet.
An elegant approach suggested by Darryl Clark involved writing the rule to redirect if the path is not an existing file or directory then route it to index.php. This approach is particularly helpful in my case because I wanted to have my Zend_AMF gateway available in a file named service.php. I’ll have to road test it and update this with my results.
Other helpful resources that I came across:
- Apache docs for the mod_rewrite
- mod_rewrite a beginner’s guide with examples
- mod_rewrite recipes
Related posts:
- Apache mod_rewrite preferred setting- right from ZF Quickstart Upon my nt
- Two ways to set of mod_rewrite You can ei
- Flex Profiler is not yet a friend of Mine. I spent a
- Zend AMF Misadventures- Pitfalls and Tips Update 1/1
- Bootstrap. You know my name! What's in the Zend Framework Bootstrap? Pardon the
Related posts brought to you by Yet Another Related Posts Plugin.








