I have a controller welcome.php
and a method cat()
. This is the query string http://localhost/CodeIgniterhi/?welcome/cat/0
. When I click on that link I can't access the method cat()
in controller welcome.php
. Why? Is there any routing problem? My default router is welcome/index.
Assuming you removed index.php
from your urls, the problem is that you have query char in url
/CodeIgniterhi/?welcome/cat/0
should be
/CodeIgniterhi/welcome/cat/0
if you have problem that you can't remove the query char ?
you should try enabling in config/config.php
this:
$config['uri_protocol'] = 'QUERY_STRING';
sincerily is not the best practice to use query strings in url, they will look not SEO friendly