วิธีจัดการ Error หน้า 404

404 – Not Found or Object Not Found

อะ คงมีหลายท่านที่ทำเว็บแล้วเกิดหน้า Error 404 แน่นอนใช่ไหมครับ Error ดังกล่าวเกิดจากมันไม่พบไฟล์ตาม URL ที่ท่านเรียก  คนที่เข้ามาเว็บเราแล้วเจอหน้า 404 นี้คงเซ็งมากๆเลยใช่ไหมครับ  เราเองถ้าเจอหน้า  404  ยังเซ็งเลย  หลายๆท่านก็มีวิธีจัดการต่างกันไป ลองมาดูภาพนี้ดีกว่า

ที่มา megamisc.blogspot.com/2008/04/error-404.html

 

อะห้า เป็นไอเดียนะครับไปต่อยอดเองละครับ แต่หากเราไม่อยากยุ่งยากแล้ววันนี้ผมมีอีกวิธีหนึ่งที่แสนจะง่าย ไม่ต้องทำอะไรสักอย่างเลยละครับ เป็น Tool ของ Google Webmaster Tools โดยประโยชน์ของมันคือ

  • It adds a search box for your site with appropriate search suggestions
    ช่วยเพิ่มกล่องค้นหาในเว็บไซต์    
     
  •   It tries to provide alternatives to incorrect URLs
    จัดการกับ URL ที่ไม่ถูกต้อง
       
     

นี้คือภาพตัวอย่างครับ

ง่ายๆครับนำ Code นี้ไปติดไว้ในเว็บของคุณ

นี้ภาษาไทย

<style type=”text/css”> #goog-wm { } #goog-wm h3.closest-match { } #goog-wm h3.closest-match a { } #goog-wm h3.other-things { } #goog-wm ul li { } #goog-wm li.search-goog { display: block; } </style> <script type=”text/javascript”> var GOOG_FIXURL_LANG = ‘th’; var GOOG_FIXURL_SITE = ‘http://www.sutenm.com/’; </script> <script type=”text/javascript” src=”http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js”></script><style type=”text/css”> #goog-wm { } #goog-wm h3.closest-match { } #goog-wm h3.closest-match a { } #goog-wm h3.other-things { } #goog-wm ul li { } #goog-wm li.search-goog { display: block; } </style> <script type=”text/javascript”> var GOOG_FIXURL_LANG = ‘th’; var GOOG_FIXURL_SITE = ‘http://www.sutenm.com/’; </script> <script type=”text/javascript” src=”http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js”></script>

นี้ภาษา Eng

<style type=”text/css”> #goog-wm { } #goog-wm h3.closest-match { } #goog-wm h3.closest-match a { } #goog-wm h3.other-things { } #goog-wm ul li { } #goog-wm li.search-goog { display: block; } </style> <script type=”text/javascript”> var GOOG_FIXURL_LANG = ‘en’; var GOOG_FIXURL_SITE = ‘http://www.sutenm.com/’; </script> <script type=”text/javascript” src=”http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js”></script>

หรือถ้าไม่ชอบแบบข้างบนอยากแก้ก็ตามนี้เลยครับ

Changing the appearance of the custom 404 widget
If you’re familiar with CSS, you can use it to change the appearance of the 404 widget on your custom 404 page. To change the appearance of your widget, add the following code to your custom 404 page:
<style type=”text/css”> /* Widget content container */ #goog-wm { } /* Heading for “Closest match” #goog-wm h3.closest-match { } /* “Closest match” link #goog-wm h3.closest-match a { } /* Heading for “Other things” */ #goog-wm h3.other-things { } /* “Other things” list item */ #goog-wm ul li { } /* Site search box */ #goog-wm li.search-goog { display: block; } </style>
Then edit the CSS to change the element you want. For example, the code below specifies:
  • The width, padding, border, and background color for the 404 widget container (#goog-wm).
  • The color of the Closest match text, its border and padding, font size, and margin (#goog-wm h3.closest-match).
  • The color of the Other things heading (#goog-wm h3.other-things).
  • The presence of the Google site search box. In the sample below, the value display:none turns the Google site search box off (#goog-wm li.search-goog). The site search box is visible by default; add this value only if you don’t want the site search box to appear (the search box is visible by default).

#goog-wm { width: 800px; padding: 1em; border: 3px solid #aebd63; background-color: white; } #goog-wm h3.closest-match { color: #8f2831; border-bottom: 3px dashed #aebd63; padding-bottom: 0.5em;; font-size: 170%; margin: 0; } #goog-wm h3.closest-match a { } #goog-wm h3.other-things { color: #8f2831; } #goog-wm ul li { } #goog-wm li.search-goog { display: none; }

Wordpress Social Share Plugin powered by Ultimatelysocial