CodeIgniter Forums
The requested URL was not found on this server - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10)
+--- Thread: The requested URL was not found on this server (/showthread.php?tid=62093)



The requested URL was not found on this server - johancelis - 06-08-2015

Hi,

I have copied my code from a publicly available server to my own machine.
I had to change a few settings to make it run locally such as the base_url.

When I access my site (using WAMP) I get the following error: The requested URL was not found....'.

I have create a custom controller that gets called when I arrive at my default controller. Within that custom controller I redirect the user to a login page.
On my public site it works fine and locally it cannot find it.

Any suggestions for debugging?

Thanks,


RE: The requested URL was not found on this server - freddy - 06-08-2015

I guess because .htaccess but please post simple code so we can analysis your problem.


RE: The requested URL was not found on this server - freddy - 06-08-2015

and also your router may be


RE: The requested URL was not found on this server - johancelis - 06-08-2015

(06-08-2015, 07:18 PM)freddy Wrote: and also your router may be

.htaccess:
RewriteEngine on

RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

Router:
$route['default_controller'] = 'welcome';

$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;


RE: The requested URL was not found on this server - manish - 06-09-2015

i think in your config.php file your base_url should be like

$config['base_url'] = 'http://'.$_SERVER['HTTP_HOST'];


RE: The requested URL was not found on this server - CroNiX - 06-09-2015

Are all of your filenames like how the userguide specifies? Windows doesn't care about case sensitivity for filenames, but just about every other OS in the world does.

You might also try adding a ? after index in this line:
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]


RE: The requested URL was not found on this server - johancelis - 06-09-2015

(06-09-2015, 07:14 AM)CroNiX Wrote: Are all of your filenames like how the userguide specifies? Windows doesn't care about case sensitivity for filenames, but just about every other OS in the world does.

You might also try adding a ? after index in this line:
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

I will check that, I moved the site from one.com to my windows machine. I remember when I renamed a file, first letter changed from or to uppercase, that on windows I saw 1 file but on the file manager of on.com I saw 2, one with uppercase and one with lowercase.


RE: The requested URL was not found on this server - johancelis - 06-09-2015

(06-09-2015, 07:14 AM)CroNiX Wrote: Are all of your filenames like how the userguide specifies? Windows doesn't care about case sensitivity for filenames, but just about every other OS in the world does.

You might also try adding a ? after index in this line:
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

Looks like this did the trick; thanks for the tip


RE: The requested URL was not found on this server - davidjoker - 05-02-2018

(06-08-2015, 09:37 PM)johancelis Wrote:
(06-08-2015, 07:18 PM)freddy Wrote: and also your router may be

.htaccess:
RewriteEngine on

RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

Router:
$route['default_controller'] = 'welcome';

$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

thank you, this works to my issues.