PHP:无法使用.htaccess中的RewriteRule访问codeignitor3中的默认index.php

The default CodeIgniter3 package is used here.
Below is the folder structure

enter image description here

Case1

   .htaccess
        RewriteEngine On
        RewriteRule    ^backoffice?$    outtest.php    [NC,L]

Trigger url: http://localhost/ci/backoffice
Output: expected output

Case2

.htaccess
    RewriteEngine On
    RewriteRule    ^backoffice?$    codeigniter/intest.php    [NC,L]

Trigger url: http://localhost/ci/backoffice
Output: expected output

Case3

RewriteEngine On
RewriteRule    ^backoffice?$    codeigniter/index.php    [NC,L]

Trigger url: http://localhost/ci/backoffice
Output: Wrong output

When i remove the contents of index.php and try the same it works fine. What should i do to make this work?