Requested URL not found in server |
Hi
I was looking the other threads related to this topic, but all changes does not making help to the outcome. I got this error The requested URL /ESS/user/login was not found on this server 404 Error Here is my .htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L] RewriteCond %{REQUEST_URI} ^application.* RewriteRule ^(.*)$ /index.php?/$1 [L] RewriteCond %{REQUEST_URI} ^asset.* RewriteRule ^(.*)$ /index.php?/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> Config.php $config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http"); $config['base_url'] .= "://".$_SERVER['HTTP_HOST']; $config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']); $route['default_controller'] = 'user';
Try this one, you may need to remove the ? question mark from the index rules.
PHP Code: <IfModule mod_rewrite.c> Also you may need to try different settings in ./application/config/config.php For this: PHP Code: /* Make sure you also set your base url. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(11-08-2018, 06:57 AM)dsubhankar Wrote: Here is my .htaccess: The following items should be removed. Code: RewriteCond %{REQUEST_URI} ^system.* In the case of the system and application, no http request to these folders should be allowed. In fact, as it is shipped, CodeIgniter includes .htaccess files that deny access to those folders and their subfolders. So, those conditions and rules are superfluous and therefore a waste of server resources. In the case of the asset folder which I assume has things like CSS, JS, and image files you don't want index.php as part of the request. A typical request for a stylesheet looks like this. Code: <link rel="stylesheet" href="https://example.com/assets/css/example.css"> But (unless I'm terribly mistaken) the rewrite you use would result in Code: <link rel="stylesheet" href="https://example.com/index.php/assets/css/example.css"> And that's going to fail miserably producing a "404 not found" for the resource. I also suggest removing the tags <IfModule mod_rewrite.c> </IfModule>. Yes, you see them used all the time in online examples. But the Apache documentation on <IfModule> has this to say about <IfModule> Quote:It should not be used to enclose directives that you want to work all the time, because it can suppress useful error messages about missing modules. It's not critical they be removed, but if you are relying on rewrite working it's probably good to have an error show up in the server logs. I'm not sure any of those changes will fix the problem though. But they should still be done. InsiteFX's suggestion of changing Code: RewriteRule ^(.*)$ index.php?/$1 [L] to Code: RewriteRule ^(.*)$ index.php/$1 [L] Is a good idea. I have to ask though, have you followed all the CodeIgniter's rules for file and class naming? |
Welcome Guest, Not a member yet? Register Sign In |