Welcome Guest, Not a member yet? Register   Sign In
How to fix Error: 404 not found?
#1

[eluser]qpixo[/eluser]
While trying to upload CI files (application & system) on private directory and files (css, image) on public directory server,
I got this 404 error not found

"Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."
I'm trying to access a link of a site.

However when using localhost every files, I don't have this error. I can see them all.

Does anyone know how to fix that?

#2

[eluser]jjDeveloper[/eluser]
did you change this

application/config/config.php
Code:
$config['base_url'] = 'http://localhost/';

to be your correct url?
#3

[eluser]talkingnews[/eluser]
Hello,

I'm having a similar problem with CI 2.1
I've changed the base_url, too.

In fact, over the last couple of hours, I've had so many iterations of the nginx config file, I'm going round in circles. Most people seem to point to this as a working example:
http://www.farinspace.com/codeigniter-ng...ite-rules/

Here's the location block - although it says "ci_starter", I've also tried the "standard" CI download, just thought I'd try something else. Both are identical.

Code:
location ci_starter/
{
# canonicalize codeigniter url end points
    # if your default controller is something other than "welcome" you should change the following
    if ($request_uri ~* ^(/welcome(/index)?|/index(.php)?)/?$)
    {
        rewrite ^(.*)$ / permanent;
    }

    # removes trailing "index" from all controllers
    if ($request_uri ~* index/?$)
    {
        rewrite ^/(.*)/index/?$ /$1 permanent;
    }

    # removes trailing slashes (prevents SEO duplicate content issues)
    if (!-d $request_filename)
    {
        rewrite ^/(.+)/$ /$1 permanent;
    }

    # removes access to "system" folder, also allows a "System.php" controller
    if ($request_uri ~* ^/system)
    {
        rewrite ^/(.*)$ /index.php?/$1 last;
        break;
    }

    # unless the request is for a valid file (image, js, css, etc.), send to bootstrap
    if (!-e $request_filename)
    {
        rewrite ^/(.*)$ /index.php?/$1 last;
        break;
    }

    # catch all
    error_page 404 /index.php;

        location ~ \.php$ {
try_files $uri =404;
            include /etc/nginx/fastcgi_params;
            fastcgi_pass unix:/var/lib/php5-fpm/web2.sock;
            fastcgi_index index.php;
fastcgi_param SCRIPT_NAME $document_root;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_script_name;
            fastcgi_intercept_errors off;
        }


}

Incidentally, although I'm new to CI and I'm sure there's lots to learn, I see in index.php that it has the lines:
Code:
define('APPPATH', BASEPATH.$application_folder.'/');
}
require_once BASEPATH.'core/CodeIgniter.php';

Which would suggest that in my CI folder, under application/core/ there should be a file called CodeIgniter.php but this is found in system/core/ - in application/core there is only index.html with a 403 forbidden.

I've turned on php error reporting, CI is in dev mode, and there's nothing to give me a clue, beyond 404.
The 404 is being generated by CI, as it's definitely not an nginx error message.
If I point it to a static text file in the folder, it works OK.

On notice that in nginx debug logging, I see the lines
2012/02/06 20:31:13 [debug] 21926#0: *506 http copy filter: 0 "/ci_starter/index.php?"
2012/02/06 20:31:13 [debug] 21926#0: *506 http finalize request: 0, "/ci_starter/index.php?" a:1, c:1

Where is that ? coming from? Given that I've also tried $config['index_page'] = ''; , should that index and ? even be there?

As I say, been a few hours now, so I'm starting to go round in circles.




Theme © iAndrew 2016 - Forum software by © MyBB