我有一個在CodeIgniter中構建的網站,它完全適用於我的本地主機,但是在將網站遷移到子域上的在線服務器時,它會提供「頁面無法工作, http://sub.domain.com是無法處理request.HTTP錯誤500"頁面無法正常工作,並返回CodeIgniter中的HTTP錯誤500
我也改變base_url
從localhost/school/
至sub.domain.com
,並 數據庫憑據也很好。
這裏是我的htaccess代碼:
我有一個在CodeIgniter中構建的網站,它完全適用於我的本地主機,但是在將網站遷移到子域上的在線服務器時,它會提供「頁面無法工作, http://sub.domain.com是無法處理request.HTTP錯誤500"頁面無法正常工作,並返回CodeIgniter中的HTTP錯誤500
我也改變base_url
從localhost/school/
至sub.domain.com
,並 數據庫憑據也很好。
這裏是我的htaccess代碼:
使用此RewriteEngine敘述後
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain\.com/subdomains/%1
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.*)\.domain\.com
RewriteRule ^(.*)$ http://domain.com/subdomains/%1/$1 [L,NC,QSA]
爲什麼2個答案? –
檢查你的網站的日誌文件中的錯誤消息。 – ourmandave