Codeigniter 404未找到错误

时间:2014-02-13 14:07:09

标签: php apache .htaccess codeigniter

大家好我一直在使用CodeIgniter开发一个没有任何问题的网站,我现在希望移动我的网站并让它现场可以这么说,我已经更新了基本URL并可以访问我的登录页面而没有问题,我还包括以下.htaccess文件:

<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /livesystem/

        # Removes index.php from ExpressionEngine URLs
        RewriteCond %{REQUEST_URI} ^system.*
        RewriteRule (.*?)$ /index.php?/$1 [L]

        RewriteCond %{REQUEST_URI} ^application.*
        RewriteRule (.*?)$ /index.php?/$1 [L]

        # Directs all EE web requests through the site index file
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
      ErrorDocument 404 /index.php
</IfModule>

然而,当我使用localhost时,CI中的以下行可以正常工作: 重定向(&#39;主&#39);

然而,当我在我的实际网站上运行时,我收到以下页面 找不到

404 Not Found: The requested URL /livesystem/index.php was not found on this server.

我已经检查过index.php实际上是在我的codeigniter根文件夹中,它是 - 有没有人有任何想法? - 我想这是我错过的非常简单的事情。任何帮助将不胜感激

1 个答案:

答案 0 :(得分:1)

您是否将$config['base_url']设置为您的域名 在.htaccess文件中更改最后一行,如下所示

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

我将继续工作

相关问题