dongzhong1891 2013-11-20 03:44
浏览 25
已采纳

由于具有相同名称的目录,未调用codeigniter控制器

I would like to avoid renaming directories or method names if at all possible, this was working on a previous server before being moved to a new hosting.

My directory structure is as follows:

  • /magazine
  • /site
  • /site/config
  • /site/config/routes.php (routes contains entry: $route["magazine"] = "site/magazine")
  • /site/controllers
  • /site/controllers/site.php (site controller contains method "magazine")
  • /site/models
  • /site/views
  • /.htaccess
  • /index.php

Everything about the site works perfectly until I browse to /magazine, and it tries to go to magazine directory, when I need it to goto the magazine method within the site controller.

Any help is greatly appreciated.

Thanks! Mike

  • 写回答

1条回答 默认 最新

  • duanbushi1479 2013-11-20 04:07
    关注

    In your htaccess file you probably have something like looks like:

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
    

    Try adding an additional rule for "magazine":

    RewriteRule ^magazine/?$ index.php/magazine [L]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作