【问题标题】:Codeigniter Url issue: HTTP 404Codeigniter 网址问题:HTTP 404
【发布时间】:2016-07-13 08:05:08
【问题描述】:

我正在开发 codeigniter 当我在 xampp 服务器上使用它时,它与这个 Url 配合得很好 localhost.com/realestate/index.php?class/method/parameter

但是当我把类似的东西放在godaddy主机上时

相同的 Url 段显示 codeigniter 404 错误

【问题讨论】:

    标签: php codeigniter url


    【解决方案1】:

    为您的文件夹添加.htaccessHere is some result Check it out all the links.

    主机区分大小写,因此在命名控制器和模型名称时也要小心

    【讨论】:

      【解决方案2】:
      DirectoryIndex index.php index.html
      
      <IfModule mod_rewrite.c>
      
      RewriteEngine On
      # RewriteBase /yourfoler/
      RewriteCond $1 !^(index\.php|assets|install|update) 
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      
      # For godady Shared Hosting Server uncomment the line below
      RewriteRule ^(.*)$ index.php?/$1 [L]
      
      # Please comment this if you have uncommented the above
      # RewriteRule ^(.*)$ index.php/$1 [NC,L,QSA]
      
      </IfModule>
      

      localhost.com/realestate/index.php?class/method/parameter 可以代替这个 localhost.com/realestate/class/method/parameterrun 像这样使用下面的 htaac​​ess

      【讨论】:

        猜你喜欢
        • 2013-09-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-09-14
        • 2011-04-02
        • 2013-05-03
        • 1970-01-01
        相关资源
        最近更新 更多