Dhara Vihol
Dhara Vihol

Reputation: 612

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.

Upvotes: 4

Views: 1395

Answers (1)

Guri
Guri

Reputation: 83

try this

RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1

Upvotes: 3

Related Questions