【发布时间】:2015-10-15 14:09:34
【问题描述】:
我正在使用 MAMP 和 CodeIgniter。 我网站的根目录是:/Users/Roy/Websites/CodeIgniter-3.0.2 在网站文件夹中,我还有一些其他项目,但我认为这并不重要。这是 apache httpd.conf 文件:http://pastebin.com/Am0ew0C0
在我的 .htaccess 文件中,我使用以下内容:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>
.htaccess 文件位于:/Users/Roy/Websites/CodeIgniter-3.0.2/.htaccess 我不知道为什么 mod_rewrite 不起作用,它应该消除在 url 中使用 index.php 因为我现在必须使用的 URL 是:http://localhost:8888/CodeIgniter-3.0.2/index.php/about
我希望它变成:http://localhost:8888/CodeIgniter-3.0.2/about 使用 PHP 版本 5.6.10。 apache没有读取.htaccess文件,问题出在这里,如何解决?
【问题讨论】:
-
不使用 index.php 时会收到什么消息?
标签: php apache .htaccess codeigniter mod-rewrite