CodeIgniter Forums
[split] Codeigniter web.config index.php rewrite inside a subdirectory - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: [split] Codeigniter web.config index.php rewrite inside a subdirectory (/showthread.php?tid=72207)



[split] Codeigniter web.config index.php rewrite inside a subdirectory - acharjeeavijit - 11-20-2018

from site_root/administration/application/config/config.php, any controller function shows 404 page not found. But if I place it i.e.
PHP Code:
[b]$config['index_page']='index.php';

it works fine.

I want to remove index.php from URL.

My question is,
How could I perform it through web.config ?
How could I perform it through .htaccess ?

I have asked this same question here but got no answer. I google it and found similar question here without any answer.

For your information, I am using CI 3


RE: [split] Codeigniter web.config index.php rewrite inside a subdirectory - tp45 - 10-09-2019

try this .htaccess
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|assets|images|js|css|uploads|favicon.png)
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-d
RewriteRule ^(.*)$ ./index.php/$1 [L]

but now you gonna have to use the routes.php in application/config/routes to make sure your controller function work