dtpf76658 2017-04-05 17:31
浏览 44

CodeIgniter没有路由请求通过/index.php/来纠正控制器

New to CI, so it's probably safe to assume misunderstandings...

My folder structure looks like

.
└── www
    ├── appthing
    │   └── V5
    │       ├── application
    │       │   ├── config
    │       │   ├── controllers
    │       │   │   ├── api
    │       │   │   └── V1
    │       │   │       ├── settings.php
    │       │   ├── ...
    │       │   └── views
    │       └── system
    └── vhosts
        └── appthing
              index.php
              .htaccess 

htaccess

My apache config in /etc/apache2/sites-available/000-default.conf looks like:

DocumentRoot /var/www/www/vhosts/appthing

 <Directory "/var/www/www/vhosts/appthing">
    AllowOverride All
 </Directory>

When I navigate to ipaddress/index.php I get an authentication error, which is good, since I can at least access the index.php file. However, if I try to go to index.php/settings I get a CI 404 error. The same code works on my computer (OS X, trying to put it on a AWS Ubuntu 16 instance currently), so it's not a problem with CI semantics.

  • 写回答

1条回答 默认 最新

  • dsaf32131 2017-04-05 17:38
    关注

    I think you need to set your Documentroot to /var/www/www/appthing/V5. Normally you should have and index.php file in your CI project which will redirect you to a home (standard = welcome.php) controller.

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度