2013-08-01 48 views
0

删除的index.php我已经改变了$config['index_page']无法从笨

$config['index_page'] = '' 

,也更新了我的.htaccess文件的内容:

RewriteEngine on 
RewriteCond $1 !^(index\.php|public|\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?$1 

但没有把指数我无法访问控制器.php在我的网址。 那么接下来我该怎么做?

+0

你在Linux或Windows上运行你的服务器吗? – ciruvan

+0

@cuewizchris,我在windows上运行 –

+1

您需要确保您的重写引擎正在运行,并且可能 - 您的vhost配置中有一行需要更改(从“AllowOverride None”到“AllowOverride All”) 。我不确定这些步骤应该如何在Windows上完成,tho。 – ciruvan

回答

0

尝试使用以下.htaccess,它适用于我。

# index file can be index.php, home.php, default.php etc. 
DirectoryIndex index.php 

# Rewrite engine 
RewriteEngine On 

# condition with escaping special chars 
RewriteCond $1 !^(index\.php|robots\.txt|favicon\.ico) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA] 
0

试试这个

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule .* index.php/$0 [PT,L] 

把这个代码在你的根文件夹htaccess文件并清除您的应用程序文件夹htaccess文件的内容。

如果您遇到任何问题,请让我知道。