dongyuan1870 2018-05-10 07:31
浏览 21

Codeigniter路线没有显示任何内容

I'm dealing with a codeigniter app that I haven't developed and is not working , if I request the main url the main controller is not called(and every route I've tried gets an 404 error), the browser shows the directory listed.

Another project on the same server with codeigniter without any changes works correctly,

Anyone know what could be the problem??

  • 写回答

1条回答 默认 最新

  • doulan1866 2018-05-10 09:05
    关注

    Make sure you have added the project folder in the base_url like below

    $config['base_url'] = 'http://'.$_SERVER['SERVER_NAME'].'/project_folder/';
    $config['index_page'] = '';
    

    and, update your .htaccess file with this code

    Options +FollowSymLinks
    Options -Indexes
    DirectoryIndex index.php
    RewriteEngine on
    RewriteCond $1 !^(index\.php|images|robots\.txt)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA] 
    
    评论

报告相同问题?

悬赏问题

  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏
  • ¥15 gg加速器加速游戏时,提示不是x86架构
  • ¥15 python按要求编写程序
  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入
  • ¥20 XP系统在重新启动后进不去桌面,一直黑屏。
  • ¥15 opencv图像处理,需要四个处理结果图
  • ¥15 无线移动边缘计算系统中的系统模型