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]
ffritz
  • 2,180
  • 1
  • 28
  • 64
  • Check this hope it help you http://stackoverflow.com/questions/29542588/remove-php-from-url/42427045#42427045 – Asif Raza Apr 24 '17 at 09:55

1 Answers1

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.

Community
  • 1
  • 1
Geordy James
  • 2,358
  • 3
  • 25
  • 34