How do I write a .htaccess file to make CodeIgniters URL routing work?

后端 未结 9 1149
死守一世寂寞
死守一世寂寞 2020-12-01 01:13

I\'m running a LAMP environment with CodeIgniter. I want to be able to use its URL pattern, like, http://localhost/controller/function/ID, but by default it has

9条回答
  •  被撕碎了的回忆
    2020-12-01 01:37

    RewriteEngine on
    RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
    RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]
    

    The simple one in .htaccess on root folder! Works for me.

提交回复
热议问题