2014-02-19 61 views
1

我刚刚买了一台Mac-PRO与小牛10.9.1网址中的index.php在此之前,我是工作在PC与Windows 7无法从Mac OSX上使用笨

我在windows下创建的项目7操作系统,现在我想将其导入到OSX,除了.htaccess文件之外,导入成功。我无法从我的网址中删除index.php。 我已经安装了甲基苯丙胺,如果我用index.php我的网址只工作:

  • 不起作用:(localhost/~username/feel/products)
  • 工作:(localhost/~username/feel/index.php/products)

我试过RewriteEngine叙述,和的RewriteCond重写规则的所有选项在.htaccess文件中。 我给所有的文件夹/文件chmod 755,已经把$config['base_url']=''$config['index_page'] = '';有和没有根或index.php页面。

文件.htaccess位于index.php页面的相同文件夹中,AllowOverride无是AllowOverride All。

回答

-1

必须设置AllowOverride AllDirectory

/private/etc/apache2/httpd.conf

182 <Directory /> 
183  Options +FollowSymLinks 
184  AllowOverride All 
185  Order deny,allow 
186  Deny from all 
187 </Directory> 

然后重新启动Apache

sudo apachectl restart 
2

我认为这个问题是关系到道路OS X处理为不同的用户阿帕奇。我使用了CodeIgniter URL documentation中描述的.htaccess文件,并使用RewriteBase添加了一行。

RewriteEngine on 
RewriteBase /~username/path/to/CI/ 
RewriteCond $1 !^(index\.php|static|robots\.txt) 
RewriteRule ^(.*)$ index.php/$1 [L] 

顺便说一句,我使用的是OS X 10.9.3(小牛)和笨2.2.0

+0

这为我做!还根据@stomdrain修改了httpd.conf。谢谢! – AshBrad