Reputation: 22674
I'm testing my php app built with Codeigniter on local host (wamp). In Firefox all my URLs go to my default controller unless I add a trailing slash.
e.g. site.com/controller/method/
Even methods not expecting a third URI segment are redirected. Does anyone know the reason behind this?
Update
application/config/routes.php
$route['default_controller'] = "pages"; //loads homepage view
$route['404_override'] = '';
I'm not using .htaccess on localserver
Upvotes: 1
Views: 1075
Reputation: 1070
Change your URL like this. This is default URL.
site.com/index.php/controller/method/
If you are configured .htaccess
site.com/controller/method/ this url is correct
Upvotes: 1
Reputation:
You mentioned you are not using .htaccess but without rewriting /controller/method/
into appropriate path your application will fail. Usual .htaccess file for a CodeIgniter application should contain at least the following configuration for rewriting
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Upvotes: 2