I have done all my initial configuration needed to remove index.php from url in config and htaccess file.
When I first load the page localhost/tech, then the view page is loaded with bootstrap and login form. But when I submit the form or generate any error in the form, then the page is being redirected to localhost/tech/index/php/login with simple page without any CSS and bootstrap. I have set my base_url to localhost/tech/index.php because without index.php the page is being redirected to localhost/tech/login and throws 404 error.
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
$config['base_url'] = 'http://localhost/tech/index.php';
.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
So there are two issues, one index.php and another one is problem after redirection or submitting form.