2012-02-12 47 views
0

我在config.php文件代碼,URL重寫不是在服務器工作,但確實在本地主機

// If URL-Rewriting does not work then set 
// define('BASE_PATH',BASE_DIR.'/index.php'); 
// If URL-Rewriting works, then leave the line below as is 
define('BASE_PATH',BASE_DIR); 

這部作品在我的本地機器好,但在服務器主機我不工作,所以我製造了一個 。 htaccess文件並在其中寫入RewriteEngine On。還是行不通。什麼可能是問題

+5

你確定服務器啓用了mod_rewrite嗎? – Cyclonecode 2012-02-12 14:24:47

+0

.htaccess還有什麼? 'RewriteEngine on'只啓用它,你也需要指定一些規則。 – 2012-02-12 14:29:50

+0

已啓用modrewrite.tags ..htaccess文件只包含一行..即rewriteengine on .. thats it – azzaxp 2012-02-12 14:32:53

回答

1

我假設你有一些ssh訪問你的服務器? 試試這個命令:a2enmod rewrite

並添加一些規則到你的.htaccess文件。 see this

+0

謝謝@ helle ..但我只是發現..從我的託管服務提供商,我需要升級我的帳戶以訪問它是 – azzaxp 2012-02-12 14:40:34

+1

是否啓用?你可以通過閱讀信息來檢查它,打印出來,當給出'phpinfo();' – helle 2012-02-12 14:43:21

+0

是modrewrite.tags啓用 – azzaxp 2012-02-12 15:14:35

相關問題