2012-06-27 131 views
2

我使用CakePHP 1.2版本,當我上傳我的網站Live服務器上,它給了我500 Internal Server ErrorCakePHP的.htaccess的500內部服務器錯誤,404找不到網頁錯誤

當我在phpinfo功能檢查mod_rewrite,其不可見,但在同一臺服務器上,另一個Joomla網站運行得很好,沒有任何htaccess或路徑重寫問題,用於htaccess頁面/路徑的Joomla AceSEF組件,所以我認爲這是Shared server它必須是這樣。

我已經嘗試了不同的選項,如在根.htaccess文件中添加'RewriteBase /'或嘗試在app/webroot/.htaccess文件中也是如此,但沒有解決方案適用於我。

即使我在根.htaccess和app/.htaccess文件中編寫'RewriteBase /',錯誤更改爲400 Page Not Found。我不知道爲什麼。

下面是htaccess的代碼:

根.htaccess文件:

<IfModule mod_rewrite.c> 
RewriteEngine on 
RewriteBase/
RewriteRule ^$ app/webroot/ [L] 
RewriteRule (.*) app/webroot/$1 [L] 
</IfModule> 

應用程序/ .htaccess文件:

<IfModule mod_rewrite.c> 
RewriteEngine on 
RewriteBase/
RewriteRule ^$ webroot/ [L] 
RewriteRule (.*) webroot/$1 [L] 
</IfModule> 

應用程序/根目錄/ .htaccess文件:

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L] 
</IfModule> 

我有廣告通過一些鏈接,如:Apache-and-mod_rewrite-and-htaccess雖然沒有太大的幫助

任何答案或解決方案,爲這個錯誤?非常感激 !!

謝謝

+1

apache錯誤日誌是什麼? – Leo

+0

@iamtheladylengend請驗證數據庫證書 –

+0

@Leo:錯誤日誌分別表示500和404錯誤 –

回答

0

檢查重寫模塊是否在apache的啓用模塊中鏈接。就像你說的那樣,它沒有列在phpinfo()中,所以這個模塊可能沒有啓用,joomla有一些解決方法。

(使用以下命令需要您自擔風險,您需要root權限) debian/ubuntu下; Apache2的啓用像你必須重新啓動的Apache2

service apache2 restart 

然後這個模塊就可以啓用了

cd /etc/apache2/mods-enabled/ 
ln -s ../mods-available/rewrite.load rewrite.load 

模塊!所以再試一次。

或者,告訴您嘗試打開的網址!

相關問題