How to remove “index.php” in codeigniter's path

后端 未结 27 1995
盖世英雄少女心
盖世英雄少女心 2020-11-22 07:17

How do I remove the \"index.php\" sticking out in every path in codeigniter somewhere in the center? I want clean non index.php-fied URLs?

27条回答
  •  说谎
    说谎 (楼主)
    2020-11-22 07:58

    If you are using Apache place a .htaccess file in your root web directory containing the following:

    RewriteEngine on
    RewriteCond $1 !^(index\.php|[Javascript / CSS / Image root Folder name(s)]|robots\.txt)
    RewriteRule ^(.*)$ /index.php/$1 [L]
    

    Another good version is located here:

    http://snipplr.com/view/5966/codeigniter-htaccess/

提交回复
热议问题