在我打开这篇文章之前,我确实花了三天时间试图弄清楚这一点,但一点运气都没有,所以请帮助我。谢谢~~~~
好的,这就是我到目前为止所做的:
- 安装 CI 2.1.3 的新副本,对任何文件夹都没有任何名称更改
- 使用我在 Google 上找到的所有结构创建一个新的 .htaccess 文件到 CI ROOT 目录
- 将 config['index_page'] 更改为空,例如。配置['index_page'] ='';
- 设置 config['uri_protocol'] = 'REQUEST_URI' 或 'QUERY_STRING'</li>
- 每次我进行上述更改时,甚至重新启动 MAMP(PHP 5.4)
- 已启用:httpd.conf 中的 LoadModule rewrite_module modules/mod_rewrite.so
- 在 https.conf 中添加“Options Indexes FollowSymLinks MultiViews”(我唯一不确定)
- (我不知道我现在应该尝试什么 V_V )
然后,我得到了这个:
是的工作: http ://ci.dev/index.php/welcome/index
不工作: http ://ci.dev/welcome/index
以下是我现在所拥有的一些细节:
.htaccess 文件:
# I got 500 error if I uncommend this line: <IfModule mod_rewrite.c>
#http://ci.dev/index.php/welcome/index this is works fine only if the above line commend out
RewriteEngine On
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/?$1 [L]
# I got 500 error if I uncommend this line: </IfModule>
配置文件
$config['index_page'] = '';
$config['uri_protocol'] = 'QUERY_STRING';
//$config['uri_protocol'] = 'REQUEST_URI';
主机文件
127.0.0.1 localhost
127.0.0.1 test.dev
127.0.0.1 ci.dev
httpd.conf 文件
#the following line also enabled
LoadModule rewrite_module modules/mod_rewrite.so in httpd.conf
...
# The following code I placed at the bottom of https.conf file
NameVirtualHost *
<VirtualHost *>
ServerName localhost
DocumentRoot "/Applications/MAMP/htdocs"
</VirtualHost>
<VirtualHost *>
ServerName ci.dev
DocumentRoot /Users/coda/Sites/ci
<Directory /Users/coda/Sites/ci>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost *>
ServerName test.dev
DocumentRoot /Users/coda/Sites/test
</VirtualHost>
请帮帮我~~~~
谢谢
==================================================== ================
感谢所有在这里尝试帮助我的人。我终于让它工作了,我认为在忽略了一些简单的事情之后,我不知何故把事情复杂化了。
我只是安装了 CI2 的另一个副本,并且只更改了 .htaccess 文件:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
然后就万事大吉了~!!!!——</p>