0

How can i remove index.php from url in codeingnator.

I have changed in config page from $config['index_page'] = 'index.php' to
$config['index_page'] = ''.

But I dont know ,where i can add .htaccess file?

Ahmed Ali
  • 1,908
  • 14
  • 28

3 Answers3

2

Need to change config file : '$config['base_url'] = ''; $config['index_page'] = ''; htaccess file :

<IfModule mod_rewrite.c> 
RewriteEngine On 
#RewriteBase /     
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^ index.php [QSA,L] 
</IfModule>
Ramki
  • 452
  • 2
  • 16
2

Re-write htaccess file with the following code.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

you could found more information Here

Dipta Das
  • 402
  • 3
  • 8
1

add this lines to .htaccess file

  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule .* index.php/$1 [PT,L]

check codeigniter documention

Hamza
  • 300
  • 1
  • 9