2012-05-15 148 views
0

嗨,我是新来的笨并以此作为我的网址笨的index.php文件,国防部重写

http://localhost/codeigniter/index.php/site 

及包括本htaccess的filr到笨文件夹后,已包括以下htaccess文件

RewriteEngine On 
RewriteBase/codeigniter 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [PT,L] 

网页停止工作都在

http://localhost/codeigniter/index.php/site 

http://localhost/codeigniter 

基本上我需要

http://localhost/codeigniter 

工作

请帮助

感谢

回答

2

你缺少你RewriteBase和基础URI之间的空白:

RewriteBase /codeigniter 

这可能是因为事情已停止工作(服务器错误状态500,您可以在错误日志中找到)。

+0

哦,是的,它的工作感谢。你能告诉我怎么能得到这个http:// localhost/codeigniter/ 到http:// localhost/codeigniter/site自动 –

+0

或者将你的整个应用程序移动到'codeigniter'文件夹下的一个名为'site'的子文件夹中并且改变你的mod重写规则要匹配。 – Repox

0

使用这一个,

RewriteEngine on 
RewriteCond $1 !^(index\.php|images|robots\.txt) 
RewriteRule ^(.*)$ /index.php/$1 [L] 

有关详细信息Click Here

+1

这会迫使他的请求被发送到http:// localhost /,而不是 - 它不是OP想要的。 – Repox

0

为了让您的codeigniter站点默认为站点控制器,您需要更新config/routes.php以将站点控制器设置为默认路由。

对于重写问题,请参阅@ Repox的答案。