【问题标题】:codeigniter - not routing to subfolder controllercodeigniter - 不路由到子文件夹控制器
【发布时间】:2014-01-20 13:07:18
【问题描述】:

我有一个基于 codeigniter 的代码,它在我的 ubuntu 机器上的 LAMP 安装中运行良好,我们将代码转移到基于 Windows 的 xampp 安装中。

控制器结构是这样的

application 
           - controllers
                 -API
                     - test.php(a test controller)
                 -test
                     - testmore.php (a test controller)
                 -test.php (a test controller, and this one works only)

当我们尝试像http://localhost/<appname>/test 那样访问 application/controllers/test.php 时,它运行良好;但是当我们尝试访问像 http://localhost<appname>/API/test/<functionName> 这样的其他控制器时,它会显示“404 Page not found”

请帮忙。

【问题讨论】:

  • 您是否正在使用 htaccess 删除 index.php?如果是这样,htaccess 不能在 windows 服务器中运行。所以尝试使用 index.php 的 url
  • 我觉得你应该把“API”改成api
  • @kumar_v .htaccess 在 Windows 上运行得很好,它不能在 IIS 上运行
  • 您必须先向我们展示您的 routes.php 和 .htaccess 文件,然后任何人才能做出明智的建议
  • 你用什么替换<appname>

标签: php codeigniter


【解决方案1】:

test 文件夹外面有一个 test.php 控制器,它可能只是混淆你的路由,去掉它,我认为它会工作

【讨论】:

    猜你喜欢
    • 2013-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-08
    • 2012-12-06
    • 2013-09-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多