2011-07-08 166 views
0

更新:刪除XAMPP apache服務器上的index.php?

好的我已經從CI配置中刪除了index.php引用,它不再出現在我的url字符串中。

當我進入我的基本URL,它工作正常,並顯示我的主頁:當我點擊我的鏈接它帶我到其他頁面我現在得到未找到對象

http://localhost/midas/

但是:

eg我點擊博客按鈕,帶我到:

http://localhost/midas/site/blog

我需要改變我的鏈接,以及現在的index.php被刪除?

Apache的錯誤日誌***

Terminating on signal SIGTERM(15) 
[Tue Jul 12 11:14:31 2011] [warn] pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run? 
[Tue Jul 12 11:14:31 2011] [notice] Digest: generating secret for digest authentication ... 
[Tue Jul 12 11:14:31 2011] [notice] Digest: done 
[Tue Jul 12 11:14:33 2011] [notice] Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations 
[Tue Jul 12 11:14:33 2011] [notice] Server built: Oct 18 2010 01:58:12 
[Tue Jul 12 11:14:33 2011] [notice] Parent: Created child process 3856 
[Tue Jul 12 11:14:35 2011] [notice] Digest: generating secret for digest authentication ... 
[Tue Jul 12 11:14:35 2011] [notice] Digest: done 
[Tue Jul 12 11:14:36 2011] [notice] Child 3856: Child process is running 
[Tue Jul 12 11:14:36 2011] [notice] Child 3856: Acquired the start mutex. 
[Tue Jul 12 11:14:36 2011] [notice] Child 3856: Starting 150 worker threads. 
[Tue Jul 12 11:14:36 2011] [notice] Child 3856: Starting thread to listen on port 443. 
[Tue Jul 12 11:14:36 2011] [notice] Child 3856: Starting thread to listen on port 80. 
[Tue Jul 12 13:02:00 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 
[Tue Jul 12 13:02:09 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 
[Tue Jul 12 13:02:24 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 
[Tue Jul 12 13:02:34 2011] [error] [client 127.0.0.1] File does not exist:  C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 
[Tue Jul 12 13:03:53 2011] [error] [client 127.0.0.1] File does not exist:  C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 
[Tue Jul 12 13:03:56 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 
[Tue Jul 12 13:04:52 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 
[Tue Jul 12 13:06:13 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/midas/site 
[Tue Jul 12 13:07:37 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 
[Tue Jul 12 13:08:05 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 

我的htaccess:

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ /index.php/$1 [NC,R=301,L] 
+0

您是否正在使用像Kohana,CI等MVC框架? – Chandu

+0

是的,我正在使用Codeigniter – Bob

+0

CI有這樣一個美麗的文檔。您是否在意檢查此頁? http://codeigniter.com/user_guide/general/urls.html – Chandu

回答

0

的-f和-d標誌應該忽視任何不是一個文件或目錄...所以如果你訪問的/ site/blog或任何URL實際上存在於請求根目錄中,它可能會嘗試在那裏路由請求而不使用你的重寫規則。

這將會是有益的知道,當你嘗試這種配置你實際看到的行爲,雖然。

0

試試這個

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ /index.php/$1 [NC,R=301,L] 
0

是否有您所使用的重定向規則(R=301)一個特別的原因?

如果您刪除的規則的那部分,所以你得到[NC,L]代替,那麼你保留的URL隱藏。

我試過在我的WAMP的服務器安裝你的規則,它工作正常上我的,你是積極的,mod_rewrite的被解僱你?

+0

哪裏是我的httpd.conf – Bob

+0

是什麼操作系統您使用 –

+0

的Windows Vista專業版,與XAMPP – Bob