相關關鍵詞
關于我們
最新文章
樂道深圳網(wǎng)站建設建設系統(tǒng)錯誤頁設置
原有系統(tǒng)在設置404錯誤的時候,是先檢測404頁面是否存在,存在則引用404頁面,然后由404頁面跳轉至首頁。在SEO方面處理還不夠徹底,對原來程序修改如下
if(HTML_MAKE_MODE === true) return false;
switch ($code){
case 404 :
$file_404 = MLEROOT.'/404.html';
file_exists($file_404) ? include($file_404) : die('<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL '.get_url().' was not found on this server.</p></body></html>');
原來的根目錄404頁面更名為error.html,然后將程序改為:
$file_404 = MLEROOT.'/error.html';
header('HTTP/1.1 404 Not Found');
header("status: 404 Not Found");
這樣在拋出錯誤的時候狀態(tài)碼就是404錯誤了!完美解決方案。