Reputation: 1926
I'm developping a project with ZF. One part of the project is still in developing and the other is already in production. Controller A is in dev, Controller B is in prod. I have set my application_env in the htaccess file. How can I solve this problem? Regards Andrea
Upvotes: 0
Views: 100
Reputation: 3128
I see you use apache as a web server. Note that I can't do any tests to confirm this works exactly like typed but I hope you get the drift and that the E flag is your friend here.
RewriteRule ^/your-dev-path/.*$ index.php [NC,E=APPLICATION_ENV:development,L]
RewriteRule ^.*$ index.php [NC,E=APPLICATION_ENV:production,L]
The E flag allows linking an env to a specific rule and the L flag essentially makes it the last rule. Hence the last line (your default rule) should not apply once the previous one is a match.
Here's the link for the docu http://httpd.apache.org/docs/2.2/rewrite/flags.html#flag_e
Upvotes: 1