To set up friendly URL in Codeigniter follow the steps below.
Note: These steps are not necessarily sequential.
In the ./sua_pasta_project/application/config/config.php files, change the following value of the index_page key of the $ config vector:
From:
$config['index_page'] = 'index.php';
To:
$config['index_page'] = '';
If it does not exist, create the .htaccess file in the root of your project (your_project_folder / .htaccess) with the following content:
Content:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
In the same config.php file change the base_url key value of the $ config;
To:
$config['base_url'] = 'http://sua_url_projeto/';
In your case it will probably be:
$config['base_url'] = 'http://localhost:8087/CodeIgniter/';
Remembering that you can access your project as well:
http://localhost:8087/sua_pasta_projeto/index.php/controller/method_action
How to:
http://localhost:8087/sua_pasta_projeto/controller/method_action
Also note that the route.php file is used to configure custom routes, not to set up Codeigniter's default friendly URL.