29 October 2010

How to access controller file directly without index.php in CodeIgnitor

code ignitor
To access controller file in codeIgnitor Framework directly without index.php as prefix, you need to create .htaccess file in your root directory.

Write the following lines in .htaccess file :

------------------------------------------------------------------------------------------
.htaccess
------------------------------------------------------------------------------------------

RewriteEngine on
RewriteCond $1 !^(index.php|images|robots.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

--------------------------------------------------------------------------------------------

Note: If you cannot create .htaccess file in Windows OS then read this Post :

(If you found this article useful then share with your friends.)

No comments: