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

后端 未结 27 1383
盖世英雄少女心
盖世英雄少女心 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

    I use these lines in .htaccess file; which I place in root folder

    RewriteEngine on
    RewriteRule ^(application|system|\.svn) index.php/$1 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
    

    Then I can access http://example.com/controller/function/parameter

    instead of http://example.com/index.php/controller/function/parameter

提交回复
热议问题