2011-06-01 99 views
0

可能重複:
how to remove index.php from url in codeigniter ?如何從笨URL刪除的index.php

我想從笨URL刪除的index.php。我創建了.htaccess文件並在其上放置了下面的代碼(如CodeIgniter網站上的代碼所示),但是我無法訪問本地主機上的任何東西,如果將代碼放在.htaccess文件中,我會得到錯誤「未找到」。

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

我的URL看起來像localhost/test/project/index.php

回答

0
Options +FollowSymLinks 
RewriteEngine on 
RewriteRule (.*)$ index.php 
1

你刪除的index.php像這樣

$config['index_page'] = '';

從配置文件在您的配置文件夾從應用程序?

0

如果您已經嘗試了用戶手冊中的所有內容,但沒有運氣,可能是本地設置存在問題。如果你在Mac上,你的Apache安裝可能會有問題。我會檢查/etc/apache2/[username].conf並確保您有AllowOverride設置爲All