My version of codeigniter is older than the current one. then.... But follow the example:
change your htaccess to:
<IfModule mod_rewrite.c>
RewriteEngine On
# Remove /index/
RewriteRule ^(.*)/index/?$ $1 [L,R=301]
# Remove trailing slashes (prevents duplicate SEO issues)
RewriteRule ^(.+)/$ $1 [L,R=301]
# Removes access to the system folder by users.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
# If not a file or directory, route everything to CI
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
# RewriteRule ^(.*)$ index.php/$1 [L] # This is an alternative
</IfModule>
In your faith:
$config['base_url'] = "http://www.seusite.com/";
# or use $config['base_url'] = "";
$config['uri_protocol'] = "REQUEST_URI";
$config['index_page'] = '';
and on your Routes: (https://www.codeigniter.com/userguide2/general/routing.html)
$route['default_controller'] = 'welcome';
$route['product/(:any)'] = "tuaconfig/action";
$route['404_override'] = "";
If your version is the current one, I saw in the current documentation ( https://www.codeigniter.com/userguide3/general/urls.html )and following her :
At the root of the framework:
application/
assets/
system/
.htaccess
index.php
Then change the application/config/config.php file:
$config['index_page'] = "index.php";
$config['index_page'] = "";
Possible duplicate: https://stackoverflow.com/questions/7618633/routes-in-codeigniter-automatically
– Mike Otharan
Maybe this link can help you: http://www.universidadecodeigniter.com.br/rotas-no-codeigniter-do-inicio-ao-fim/
– Mike Otharan
It is not duplicated, this topic is in American stackoverflow, this is PT. I’ve looked at this tutorial and done exactly the same, but it didn’t work no :/ !
– Higor Lamonier