Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove index.php from codeigniter in subfolder

My codeigniter is installed in admin_new folder on hostinger and path of installed codeigniter is public_html/vishwa/admin_new/ and i am trying to remove index.php from url.

I have changed my .htaccess file as below.

RewriteEngine on
RewriteBase /vishwa/admin_new/
RewriteRule ^(application|system|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

I have checked forums and it says mode_rewrite is enabled as default on hostinger. but it is showing error like No input file specified.

I have also changed config settings in config.php as below:

$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

but still it is showing same error. Why this type of error has been shown and how can i solve it.

like image 920
Dhara Vihol Avatar asked Sep 10 '25 13:09

Dhara Vihol


1 Answers

try this

RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1
like image 163
Guri Avatar answered Sep 13 '25 06:09

Guri