[Codeigniter]将2.0放入文件夹1.7时未找到错误404
当我使用多个 Web 时,我遇到了问题,将 CI 2.0 放入使用 CI 的文件夹中,就像
我使用 CI 1.7 实现的那样 http://www.domain.com/webci17/webci20 domain.com 使用普通的 php 代码,不使用框架。 webci17使用CI 1.7来实现 webci20使用CI 2.0来实现 我可以访问 www.domain.com/webci17
但是当我访问 www.domain.com/webci17/webci20
它将重定向到 404 未找到页面 我通过在 webci20 中编辑 index.php 来检查任何文本,它会随着我的更改而更改显示,但是当更改回默认 CI index.php 时,它会再次重定向到 404 未找到页面。 我不确定它是否涉及 CI 版本,但我认为不是。 任何人都可以解决这个问题吗? 谢谢。
I got problem when I use multiple web by put CI 2.0 in the folder that use CI like this
I implement with CI 1.7 as
http://www.domain.com/webci17/webci20
domain.com use normal php code not use framework.
webci17 use CI 1.7 to implement
webci20 use CI 2.0 to implement
I can access to www.domain.com/webci17
but when I acces to
www.domain.com/webci17/webci20
It’s will redirect to 404 not found page
I check by edit index.php in webci20 to any text it’s change display as I change but when change back to default CI index.php it redirect to 404 not found page again.
I'm not sure it involve version of CI but i think not.
Anyone can solve this problem?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过这种方式(如果我正确地得到你的答案),你告诉 CI1.7 安装(它抓取 url 并解释它)寻找一个名为“webci17”的控制器和一个名为“webci20”的方法(假设你没有不做任何重新映射)。当然,您会收到 404 not found 错误。
您当然可以在同一台服务器上进行 2 个不同的安装,即使版本不同,但您可以通过分离文件夹(并设置相应的变量)来实现这一点,如用户指南中明确指出的: managing_apps
如果您希望在安装中集成某些内容,就好像它是另一个 CI 安装一样,您可以考虑使用HMVC 实现 codeigniter 模块化扩展 但这是一个不同的故事,我非常怀疑它是否可以与 2 个不同版本的 CI 一起使用(许多功能在最新版本中已被重命名和/或取消)。
您也可以尝试升级到最新版本(2.0.2),您可以在他们的论坛中找到有关如何执行此操作的信息(例如,请查看 此线程)
By doing this way (if I get your answer correctly) you're telling the CI1.7 installation (which grabs the url and interprets it) to look for a controller named "webci17" and a method called "webci20" (assuming you didn't do any remap). Of course you're getting the 404 not found error.
You surely can have 2 different installation on the same server, even if of different version, but you achieve this by separating the folders (and settings the respective variable), as clearly indicated in the user guide: managing_apps
If you're looking to integrate something in your installation, as if it were another CI install, you could take into account using the HMVC implementation codeigniter modular extension but it's a different story and I higlhy doubt it will work with 2 different versions of CI (many functions have been renamed and/or suppressed in the latest version).
You could, also, try upgrading to the latest version (2.0.2), you can find informations on how to do it in their forum (for. ex, look at this thread)