2017-06-26 61 views
0

我在localhost中有項目,我應用重寫簡單規則,它在localhost中工作正常。當我在cpanel中上傳。重寫URL(htaccess)只能爲一個頁面工作,但不能爲其他人工作。意味着它給我500內部錯誤。我轉換Profile.php到domain.com/profile約-us.php到domain.com/about-us但它給我的500錯誤在服務器中使用htaccess時發生500錯誤

# Turn Rewrite Engine On           
RewriteEngine on             
RewriteRule ^profile$ Profile.php [NC,L]       
RewriteRule ^profile-setting$ User-Profile.php [NC,L]    
RewriteRule ^checkout$ checkout.php [NC,L]       
RewriteRule ^summer-store$ product.php [NC,L] 

只有最後product.php頁工作localhost及的cPanel ,但其他只在本地主機上工作不在cPanel(500錯誤)。問題存在的地方。很多預先感謝

+0

你是什麼意思'我將Profile.php轉換爲domain.com/profile'?您是否更改了文件名或只是對頁面的引用?你得到一個Apache錯誤或PHP錯誤? – chris85

+0

like domain.com/Profile.php頁面存在於我的服務器上我想轉換domain.com/profile爲此我應用該規則RewriteRule^profile $ Profile.php [NC,L]它給出「目前無法處理這個請求。 HTTP ERROR 500「 –

+0

charis85請問你能幫我嗎? –

回答

0

如果您擁有託管網站的服務器的根訪問權限,只需使用root登錄到服務器用戶,並在瀏覽有問題的頁面時檢查路徑/ usr/local/apache/logs/error_log中的日誌。錯誤日誌會告訴你發生了什麼,然後你可以相應地應用修復。

相關問題