0

I referred the CodeIgniter Site and also checked various sites for information on how to remove index.php file from Mac OS X 10.10. But still index.php is unavoidable. I need steps to remove index.php from CodeIgniter on Mac OS 10.10.

This is working: localhost/jenny/Learn/index.php/about

This is not working: localhost/jenny/Learn/about

1

2 Answers 2

1

As long as you are running apache the operating system should not make a difference in this case.

You need to create a .htaccess file within the your root web directory (this is the directory where the index.php file is located) and within the .htaccess file you will want to include the following:

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

This will allow you to utilize the second url you have posted as it will determine if the requested resource is located within the webroot and if not then redirect to the index.php file without it needing to be included in the url.

If you are not running a different web server then the rewrite rule will be different but the principle is the same. Send all requests to index.php if not resource does not live in web root.

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

Comments

1
open path:/application/config/config.php           
find : $config['index_page']='index.php'        
replace : $config['index_page']=''       

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.