Similar question asked here: Htaccess rule to make urls like this ?page=1 look like /page/1 in Codeigniter
But I can't get the answer right.
My routes.php
$route[$key] = "home_controller/index";
$route['page/(:num)'] = 'home_controller/index/$1';
My .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
My config.php
$root .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
$config['base_url'] = $root;
$config['index_page'] = '';
$config['uri_protocol'] = 'PATH_INFO';
Can't understand the syntax. Been looking all over in Codeigniter Docs such as; https://codeigniter.com/userguide3/general/routing.html I just can't seem to find the solution for this.
host/page/1
Is working but not redirecting to the desired page in other words its not corresponding to it's page in the pagination
host/?page=1
Is working but I simply want to get rid of ?page=
I also need to fix a path url for host/category/?page=1
to host/category/page/1