2014-01-14 40 views
1

我搜索了很多網站和很多鏈接,我也按照相同的方式啓用了htacces,但是面臨問題,現在作爲默認使用index.php,即使當我運行沒有index.php的頁面時沒有工作,即使msg到服務器上找不到網頁我已經在Apache模塊中啓用也httpd.conf文件從重寫模塊中刪除#符號,我使用下面提到的代碼在htaccess文件中代碼提供的建議我共享htaccess代碼htaccess - 使用codeigniter框架

RewriteEngine On 
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L] 

請建議,這樣我就可以解決WAMP服務器

+0

你重新啓動'WAMP'在'httpd.conf' –

+0

重啓服務也重新啓動電腦也進行更改後。 – FormaL

回答

2

在這個問題上嘗試在你的htaccess的代碼:

RewriteEngine On 
RewriteBase /my_project_name/ 
# Do not enable rewriting for files or directories that exist 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
# Rewrite to index.php/URL 
RewriteRule ^(.*)$ index.php/$1 [PT,L] 
+0

它的工作原理,我提到項目名稱它工作正常! – FormaL

+0

我已經接受:p msg一次又一次地來了3分鐘等待,這就是爲什麼我等待:D – FormaL

+0

我還有一個問題,你可以看到代碼,並建議 – FormaL

0

試試這個

DirectoryIndex index.php 
RewriteEngine on 
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]