Welcome Guest, Not a member yet? Register   Sign In
404 Error Pages Don't Work for Me
#3

[eluser]Burak Erdem[/eluser]
@Cro_Crx It doesn't show any error page in Google Chrome because Chrome never stops loading the page. Firefox gives the standard "File Not Found" error. Let me explain this a bit more.

I have a controller named "user" and a "details" function in this controller. When I browse to http://localhost/public/user/details my browser successfully displays the page. But when I try to browse like http://localhost/public/user/login (which "login" function doesn't exist) Google Chrome never stops loading, and Firefox gives the above error.

Btw I've changed the directory structure a little bit. But I think directory structure has no effect on this because when I try this with the standard CI installation, this situation doesn't change.

This is what my directory structure looks like.

[Image: http://img18.imageshack.us/img18/1487/74675804.th.png]

Here is my /public/.htaccess file
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On

    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>

And my /public/index.php file (removed comments, edited $system_folder and $application_folder)
Code:
&lt;?php
error_reporting(E_ALL);
$system_folder = "../codeigniter";
$application_folder = "../application";

if (strpos($system_folder, '/') === FALSE)
{
    if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
    {
        $system_folder = realpath(dirname(__FILE__)).'/'.$system_folder;
    }
}
else
{
    $system_folder = str_replace("\\", "/", $system_folder);
}

define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION));
define('FCPATH', __FILE__);
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
define('BASEPATH', $system_folder.'/');

if (is_dir($application_folder))
{
    define('APPPATH', $application_folder.'/');
}
else
{
    if ($application_folder == '')
    {
        $application_folder = 'application';
    }

    define('APPPATH', BASEPATH.$application_folder.'/');
}

require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;


Messages In This Thread
404 Error Pages Don't Work for Me - by El Forum - 07-30-2009, 06:58 AM
404 Error Pages Don't Work for Me - by El Forum - 07-31-2009, 09:24 AM
404 Error Pages Don't Work for Me - by El Forum - 08-01-2009, 08:37 AM
404 Error Pages Don't Work for Me - by El Forum - 08-09-2009, 03:41 PM
404 Error Pages Don't Work for Me - by El Forum - 08-09-2009, 03:50 PM
404 Error Pages Don't Work for Me - by El Forum - 08-09-2009, 03:57 PM
404 Error Pages Don't Work for Me - by El Forum - 08-09-2009, 04:00 PM
404 Error Pages Don't Work for Me - by El Forum - 08-09-2009, 04:09 PM
404 Error Pages Don't Work for Me - by El Forum - 08-09-2009, 04:22 PM
404 Error Pages Don't Work for Me - by El Forum - 10-09-2009, 04:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB