2014-02-19 135 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