1

I want to remove "Index.php" from every url of the project. I follow many instruction of previous asked question. But i am unable to solve the issue. I am unable to find the actual .htaccess file. My Codeigniter version is "3.0.6" .htaccess file contain this

<IfModule authz_core_module>
    Require all denied
</IfModule>
<IfModule !authz_core_module>
    Deny from all
</IfModule>

enter image description here

Please guide me. If any information is missing in this question please let me know. I am new in Codeigniter.

3
  • 1
    Have a look here github.com/riwakawebsitedesigns/htaccess_for_codeigniter but if your also using wamp enable mod rewrite don't touch the htaccess in the application folder. Commented May 4, 2016 at 19:11
  • there is too many file present in the above link... Can you guide me which file should i use. ? Commented May 4, 2016 at 19:18
  • @wolfgang1983 thanks for helping me fix this issue Commented Jul 9, 2016 at 8:38

1 Answer 1

3

you only need to create the .htaccess file on the same level as your index

.htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Sign up to request clarification or add additional context in comments.

3 Comments

In which file i put all this? Can you explain me how does it work...?
It works fine.. @elddenmedio Please Explain all the keyword used in the .htaccess file. How its work?
RewriteEngine On - activate the rewrite mode RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d - if the file with the specified name in the browser doesn't exist, or the directory in the browser doesn't exist then procede to the rewrite rule below RewriteRule ^(.*)$ index.php/$1 [L] - ignore the url and the parameter $1 will be executed

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.