2012-04-15 100 views
0

我是codeigniter的新手。我最近開始了一個在codeigniter中開發的項目。在本地主機上使用Codeigniter

我已經下載了該項目並在本地進行了處理,然後將更新上傳到現場。

問題是,當我在本地運行它檢查例如http://localhost/example/index.php/homehttp://localhost/example/它直接轉到實況網站www.example.com/index.php/home instaed http://localhost/example,我也改變了application/config/config.php中的base_url。

請幫助我。

+0

您可以發佈您的視圖代碼,所以我們可以看到問題出在哪裏?即它聽起來像你已經硬編碼你的鏈接到實時網址? – Laurence 2012-04-15 04:55:14

+0

檢入.htaccess文件的根文件夾,可能會將您重定向到遠程服務器。 – Dale 2012-04-15 09:29:04

回答

0

把它保存在的.htaccess

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule .* index.php/$0 [PT,L] 
+0

現在您可以調用像 – 2012-04-16 09:30:53

+0

http:// localhost/example /或http:// localhost/example/home – 2012-04-16 09:31:15