我正在使用codeigniter,正在考虑如何创建主页控制器,http://localhost的控制器。到目前为止,我可以访问http://localhost/{controller}的所有控制器,而不仅仅是localhost。我的。htaccess如下:
RewriteEngine on
RewriteCond $1 !^(index'.php|images|css|sandbox|scripts|robots'.txt)
RewriteRule ^(.*)$ /index.php/test/$1 [L]
在routes.php中设置default_controller为你想要使用的控制器的名称