没有 mod_rewrite 的 php Zend/MVC
我在网络上的许多博客中都看到过它,但我认为应该在这里讨论它.当我们在 PHP 中有一个 MVC 框架(我对 ZEND 感兴趣)但我们的主机不提供 mod_rewrite 时,我们该怎么办?有什么捷径"吗?我们可以以任何方式转移控制权(以便页面之间可能发生映射)?有任何想法吗?谢谢:-)
I've seen it mentioned in many blogs around the net, but I believe it shoud be discussed here. What can we do when we have an MVC framework (I am interested in ZEND) in PHP but our host does not provide mod_rewrite? Are there any "short-cuts"? Can we transfer control in any way (so that a mapping may occur between pages)? Any ideas? Thank you :-)
推荐答案
Zend 框架应该可以在没有 mod_rewrite
的情况下工作.如果你能忍受你的 URL:s 看起来更像/path/to/app/index.php/controller/action".如果你有 mod_rewrite,你可以去掉index.php"位,但它也应该可以使用.
Zend framework should work without mod_rewrite
. If you can live with your URL:s looking more like "/path/to/app/index.php/controller/action". If you had mod_rewrite you could do away with the "index.php" bit, but it should work with too.
设置路由以接受 index.php 部分就是一个问题.
It's all a matter of setting up the routes to accept the index.php part.
相关文章