doumiao0498 2016-03-31 07:17
浏览 60

从URL Codeigniter 1.7.2中删除index.php

I have moved my codeigniter project and all the related databases from old server (Centos 5.11) to new server (Centos 6.7). In the old server, the task of removing the index.php from URL was already handled with the help of the .htacess files and other changes. I have moved the entire project on the new server without making any changes. When I visit the main page of the project i.e. the login page it works fine and gets displayed without any issue. But the moment I login, I get a 404 error page. But when I add index.php fragment at the required place then it works! Did moving the project to latest server version cause a problem?

  • 写回答

2条回答 默认 最新

  • dougang6821 2016-03-31 07:35
    关注
     RewriteEngine On
     Options All
    
     #php_flag display_errors Off
     #php_value error_reporting 1
     #php_value post_max_size 8M
     #php_value upload_max_filesize 8M
     #php_value memory_limit 150M
     # These settings when uncommented, giving 500 Internal Server Error on 
     # the new server http://119.18.48.12
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    #RewriteRule ^/(.*).php         /uat/index.php/$1.php [L,NC]
    RewriteRule ^/(.*).php          index.php/$1.php [L,NC]
    
    #Local Server Setting
    #RewriteRule ^admin/(.*)            administration.php/$1 [L,NC]
    #LIVE Server setting
    RewriteRule ^admin/(.*)         /uat/administration.php/$1 [L,NC]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    #Local Server Setting
    #RewriteRule ^(.*)$             index.php/$1 [L]
    #LIVE Server setting
    RewriteRule ^(.*)$          /uat/index.php/$1 [L]
    
    评论

报告相同问题?

悬赏问题

  • ¥15 我的代码无法在vc++中运行呀,错误很多
  • ¥50 求一个win系统下运行的可自动抓取arm64架构deb安装包和其依赖包的软件。
  • ¥60 fail to initialize keyboard hotkeys through kernel.0000000000
  • ¥30 ppOCRLabel导出识别结果失败
  • ¥15 Centos7 / PETGEM
  • ¥15 csmar数据进行spss描述性统计分析
  • ¥15 各位请问平行检验趋势图这样要怎么调整?说标准差差异太大了
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 wpf界面一直接收PLC给过来的信号,导致UI界面操作起来会卡顿
  • ¥15 init i2c:2 freq:100000[MAIXPY]: find ov2640[MAIXPY]: find ov sensor是main文件哪里有问题吗