-1

http://localhost/codeigniter/index.php/user/main_page

how can you remove index.php from this url ?

Abhishek
  • 1,543
  • 3
  • 13
  • 29
anumol
  • 431
  • 4
  • 14
  • 1
    possible duplicate of [How to remove "index.php" in codeigniter's path](http://stackoverflow.com/questions/1445385/how-to-remove-index-php-in-codeigniters-path) – Jonathan Solorzano Sep 30 '15 at 04:17

3 Answers3

1

Try this file. I use it in my projects

https://github.com/eborio/curso-de-codeigniter/tree/master/02-primeros-pasos

0

The answer is in the post that this question is ducplicated of.

This is the answer

Sean Vieira's answer:

If you are using Apache place a .htaccess file in your root web directory containing the following:

RewriteEngine on
RewriteCond $1 !^(index\.php|[Javascript / CSS / Image root Folder name(s)]|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

Another good version is located here:

http://snipplr.com/view/5966/codeigniter-htaccess/

Community
  • 1
  • 1
Jonathan Solorzano
  • 6,812
  • 20
  • 70
  • 131
0

Try this:

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

Replace:

$config['index_page'] = "index.php"
to
$config['index_page'] = ""

 if it still not work try to replace:

 $config['uri_protocol'] = "AUTO"
//replace with the below code
$config['uri_protocol'] = "REQUEST_URI"

for more details: http://w3code.in/2015/09/how-to-remove-index-php-file-from-codeigniter-url/ check this

Rajat
  • 21
  • 3