【发布时间】:2014-08-19 06:34:49
【问题描述】:
我已经使用 xampp 和 codeIgnitor 在 windows 基础机器上开发了一个系统,所以我将开发环境更改为 mac os 10.9 相同的系统给我错误 404。所以将 index.php 放入 URL 问题已解决。但我想知道它是如何发生的。因为我已经在 windows 环境中使用 htaccess 文件删除了 index.php。我想知道如何在 mac os 10.9 中删除 index.php。
这是我的 htaccess 文件内容。
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L]
/Applications/XAMPP/xamppfiles/etc/httpd.conf 文件也编辑如下
- 启用重写模块“LoadModule rewrite_module modules/mod_rewrite.so”
-
更改用户名
用户****** 组守护程序
-
更改权限
允许覆盖所有 要求所有授予
CodeIgnitor 配置文件也编辑如下
- change base url
$config['base_url'] = 'http://localhost/ci2.2/';
- Remove index.php
$config['index_page'] = '';
- Change URL Protocol
$config['uri_protocol'] = 'AUTO';
我将文件放在 /Applications/XAMPP/xamppfiles/htdocs/ci2.2 目录中
【问题讨论】:
标签: macos .htaccess codeigniter mod-rewrite xampp