首页 文章

删除xampp mac os 10.9中的index.php codeIgniter不起作用

提问于
浏览
0

我已经使用xampp和codeIgnitor在windows base机器上开发了一个系统,所以我将开发环境改为mac os 10.9同样的系统给我错误404.所以把index.php放到URL修复的问题上 . 但我想知道它是如何发生的 . 因为我已经在windows环境中使用htaccess文件删除了index.php . 我想知道如何删除mac os 10.9中的index.php .

This is my htaccess file content.

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L]

/Applications/XAMPP/xamppfiles/etc/httpd.conf File also edited as follows

  • 启用重写模块"LoadModule rewrite_module modules/mod_rewrite.so"

  • 更改用户名

用户******组守护程序

  • 更改权限

AllowOverride All要求全部授予

CodeIgnitor config file also edited as follows

- change base url

    $config['base_url'] = 'http://localhost/ci2.2/';

 - Remove index.php

    $config['index_page'] = '';

 - Change URL Protocol

    $config['uri_protocol'] = 'AUTO';

I put my files in /Applications/XAMPP/xamppfiles/htdocs/ci2.2 directory

1 回答

  • 0

    试试这个htacess内容:

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

    参考:http://ellislab.com/codeigniter/user-guide/general/urls.html

    如果您使用的是子目录,请用此替换最后一行:

    RewriteRule ^(.*)$ /[SUBDIRECTORY]/index.php/$1 [L]
    

    用目录名替换[SUBDIRECTORY]

相关问题