2013-07-10 56 views
2

我在wamp服務器中創建了虛擬機。一切正常,但我無法刪除index.php。我不知道如何編寫.htaccess。移動到虛擬主機後,Codeigniter無法刪除index.php

下面是詳細信息

NameVirtualHost *:80 
<VirtualHost *:80> 
DocumentRoot E:/Projects/OnGoing/bonanza/dev.bonanza.com 
ServerName dev.bonanza.com 
    <Directory "E:/Projects/OnGoing/bonanza/dev.bonanza.com"> 
     Options Indexes FollowSymLinks 
     AllowOverride None 
     Order allow,deny 
     Allow from all 
    </Directory> 
</VirtualHost> 

和我的htaccess

# Turn on URL rewriting 
RewriteEngine On 

# Installation directory 
RewriteBase/

# Allow these directories and files to be displayed directly: 
# - index.php (DO NOT FORGET THIS!) 
# - robots.txt 
# - favicon.ico 
# - Any file inside of the media/ directory 
RewriteRule ^(index\.php|robots\.txt|favicon\.ico|media|uploads|js|css|images|plugins|source|files|fonts|lib|plugins) - [PT,L] 

# Rewrite all other URLs to index.php/URL 
RewriteRule .* index.php?/$0 [PT,L,QSA] 

回答

2

你設置你的主機文件中正確讀取你的網站的路徑?對我來說,我一直在開發服務器上使用它。

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-s 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond $1 !^(index\.php|images|robots\.txt) 
RewriteRule ^(.*)$ /index.php/$1 [L] 
+0

感謝您的答覆,看看這個 - 127.0.0.1 dev.bonanza.com 這是我在主機 –

+0

我加入你的htaccess它仍然沒有工作 –

+0

你檢查我的虛擬主機設置添加?有什麼不對?實際上一切都爲我工作,但不能從url中刪除index.php :( –