简体   繁体   English

未找到Codeigniter 404错误

[英]Codeigniter 404 Not Found Error

Hi all I have been developing a site using CodeIgniter without any issue, I am now hoping to move my site and make it live so to speak, I have updated the base URL and can access my login page without an issue, I also inlcuded the following .htaccess file: 大家好,我一直在使用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>

however when I was working with localhost the following lines in CI would work without an issue: redirect('main'); 但是,当我使用localhost时,CI中的以下行将正常工作而不会出现问题:redirect('main');

however when this runs on my live site I am receiving the following page back Not Found 但是,当它在我的实时网站上运行时,我收到以下页面:找不到

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

I have checked that the index.php is infact within my codeigniter root folder and it is - has anyone got any ideas? 我已经检查了indexign.php是否在我的codeigniter根文件夹中是真实的,它是-有人知道吗? - I guess this is something really simple that I have missed. -我想这是我错过的非常简单的事情。 Any help would be much appreciated 任何帮助将非常感激

Do you set the $config['base_url'] as your domain name in .htaccess file change the last line as like this 您是否将$config['base_url']为.htaccess文件中的域名,像这样更改最后一行

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

i will it's work 我会的工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM