-1

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

how can you remove index.php from this url ?

1

3 Answers 3

1

Try this file. I use it in my projects

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

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

Comments

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/

Comments

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.