php Zend / MVC without mod_rewrite(没有 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.
这篇关于没有 mod_rewrite 的 php Zend/MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:没有 mod_rewrite 的 php Zend/MVC


基础教程推荐
- PHP 守护进程/worker 环境 2022-01-01
- Doctrine 2 - 在多对多关系中记录更改 2022-01-01
- phpmyadmin 错误“#1062 - 密钥 1 的重复条目‘1’" 2022-01-01
- 在 CakePHP 2.0 中使用 Html Helper 时未定义的变量 2021-01-01
- 使用 PDO 转义列名 2021-01-01
- 如何在 Symfony 和 Doctrine 中实现多对多和一对多? 2022-01-01
- HTTP 与 FTP 上传 2021-01-01
- 如何在 XAMPP 上启用 mysqli? 2021-01-01
- 找不到类“AppHttpControllersDB",我也无法使用新模型 2022-01-01
- 在 yii2 中迁移时出现异常“找不到驱动程序" 2022-01-01