我做了什麼,它是在htaccess的說:笨不會重定向URL
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');
}
}
的htaccess:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
[笨htaccess的子文件夾的問題]的可能重複(http://stackoverflow.com/questions/7527491/codeigniter-htaccess-subfolder-problem) – Ben 2012-04-13 07:08:21