修改.htaccess文件以与CodeIgniter库一起使用

CodeIgniter library is uploaded on public_html/ci/ folder. I have already set the default controller inside application/config/routes.php as my default controller.

Now I want to update .htaccess file to match calls on mysite.com to mysite.com/ci/index controller or mysite.com/about to match mysite.com/ci/about controller, that pattern would use.

How can I do that?

Add below lines to your .htaccess. Place .htaccess file under public_html/ci/

RewriteEngine On
RewriteBase /ci

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond $1 !^(index\.php)
RewriteRule ^(.*)$ /index.php/$1 [L]