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

后端 未结 9 1140
死守一世寂寞
死守一世寂寞 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:30

    Put that at the document root of your Web site.

    If you have multiple sites, put it at the top of each such site.

    If you have multiple sites running from the same directory, you can use a RewriteCond to exclude or include particular sites to the rewrite rule.

    You can exclude certain directories (eg /articles) the same way.

提交回复
热议问题