我做了 htaccess 中所说的:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
我把上面的,这样我就可以做到这一点:
http://localhost/Speakom2/Home/index
代替:
http://localhost/Speakom2/index.php/Home/index
但它不起作用......我收到 404 错误......如何解决这个问题,让它工作?!?
控制器:
class Home extends CI_Controller {
public function Index()
{
$this->load->view('welcome_message');
}
}
访问:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]