How to use .htaccess with code igniter |
[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> Code: class Home extends Controller { Code: http://localhost/hello_world/home/test_func and when i add index.php as Code: http://localhost/hello_world/index.php/home/test_func 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
[eluser]Sumon[/eluser]
change .htaccess to Code: <IfModule mod_rewrite.c>
[eluser]mattthehoople[/eluser]
RewriteEngine on RewriteRule ^(home|controller2|controller3|etc)/?(.*) index.php/$1/$2
[eluser]mattthehoople[/eluser]
...or you could exclude any files you don't want rewritten (including index.php) and do the rest RewriteEngine on RewriteRule ^(js|css|flash|includes|index.php) - [L] RewriteRule ^(.*) index.php/$1 [L] |
Welcome Guest, Not a member yet? Register Sign In |