【发布时间】:2013-08-02 05:31:31
【问题描述】:
我已将$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
但如果不将 index.php 放入我的 url,我将无法访问控制器。 那么接下来我该怎么做呢?
【问题讨论】:
-
您的服务器是在 Linux 还是 Windows 上运行?
-
@cuewizchris,我在 Windows 上运行
-
您需要确保您的重写引擎正在运行,并且 - 也许 - 您的虚拟主机配置中有一行需要更改(从“AllowOverride None”到“AllowOverride All”)。我不确定这些步骤应该如何在 Windows 上完成。
-
.htaccess 在 Windows 服务器上默认没有打开。首先确保是这种情况。看看这个回复和关于配置它的文章:stackoverflow.com/questions/14148489/…
-
看看这篇文章.....stackoverflow.com/questions/17852585/…
标签: php codeigniter .htaccess