Welcome Guest, Not a member yet? Register   Sign In
How to use .htaccess with code igniter
#1

[eluser]Unknown[/eluser]
i have downloaded CI 1.7 and extract in my root. my project named hello_world. here is my .htaccess file and it's location is /hello_world/.htaccess
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
i write a simple controller named home
Code:
class Home extends Controller {
    function __construct()
    {
        parent::Controller();    
    }
    function test_func()
    {
        echo 'test_func';
    }
}
i am trying to access
Code:
http://localhost/hello_world/home/test_func
but it shows me output of http://localhost/ (wamp home page)
and when i add index.php as
Code:
http://localhost/hello_world/index.php/home/test_func
it works fine.
what changes needed in .htaccess file?
FYI: my mod_rewrite is on and i am using WampServer Version 2.0. in addition i have not changed index.php file location.
thanks in advance


Messages In This Thread
How to use .htaccess with code igniter - by El Forum - 11-25-2008, 12:29 PM
How to use .htaccess with code igniter - by El Forum - 11-25-2008, 12:39 PM
How to use .htaccess with code igniter - by El Forum - 11-26-2008, 11:32 AM
How to use .htaccess with code igniter - by El Forum - 11-26-2008, 11:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB