0

Hello friends i have sub domain like exam.example.com, i need to remove index.php from url my url like exam.example.com/index.php/controller/func_name

i had replace following in config.php

$config['index_page'] = 'index.php'; 

replace

$config['index_page'] = ''; 

and create .htaccess file in my project and wrote following code -

RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] 
1

1 Answer 1

0

I also hosted one of my CodeIgniter project as a subdomain like yours. I don't face any issue like you.

I also replaced following in config.php $config['index_page'] = 'index.php'; replace with $config['index_page'] = '';

Here is my .htaccess file

<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] </IfModule> 

If this .htaccess file did not work for you need to allow overriding of htaccess in Apache Configuration. visit Codeigniter - getting 404 Not Found error for more information about .htaccess overriding.

Sign up to request clarification or add additional context in comments.

Comments