.htaccess Redirect Hack

ขอแชร์ประสบการ์ณเรื่องเว็บโดน Hack โดยการเขียนไฟล์ .htaccess ให้ Redirect ไปยังโดเมน http://ns1.chestermoon.com

อาการของมันคือเข้าหน้าบ้างหน้าได้ บ้างหน้ามันจะขึ้น Error แล้วก็จะฟ้องเรื่อง DNS อะไรสักอย่างเกี่ยวกับเว็บ http://ns1.chestermoon.com นี้ แต่บ้างครั้งมันจะไม่ฟ้องอะไรเลย เราก็จะต้องนั่งหาสาเหตุอยู่นานถึงจะมาเจอว่าไฟล์ .htaccess ถูกแก้ไข ขอเตือนไว้ก่อนว่ามันไม่ได้อยู่แค่ Root Domains มันขึ้นไปอยู่ใน Root Path ที่ FTP สามารถเข้าได้เลยครับ บ้างท่านอาจจะแก้แค่ Root Domains แต่มันจะไม่หาย เราต้องเข้าไปแก้ไฟล์ .htaccess Root Path ด้วยนะครับ จะลบไปหรือจะลบแค่ Code ของมันที่ทำงานก็แล้วแต่ครับ

อันนี้เป็น Code .htaccess Redirect ที่ผมโดนครับ ฝากไว้เป็นตัวอย่างให้ทุกท่านครับ Continue reading “.htaccess Redirect Hack”

โปรดระัวัง Template มีการฝั่ง Ifame

วันนี้ผมได้โหลด Template อันหนึ่งไปใช้ครับ จากนั้นทำการปรับแต่งจนเสร็จเรียบร้อยแล้ว แต่แปลกใจตรงที่หน้าเว็บมันโหลดช้ามากกว่าปกติ จึงทำการตรวจสอบ Code ของ Template ในทุกๆ ส่วน ก็พบว่าใน Template มีการฝั่ง iFame ไว้ ถ้าใครโหลดไปก็ควรตรวจสอบ Template ที่ใช้งานด้วยนะครับ ไม่งั้นอาจจะตกเป็นเหยือได้ง่ายๆ สำหรับ Template ที่ผมโหลดไปใช้นั้นได้ทำการ ifame ไปยังเว็บ wpstyles.org ครับ แต่มันหลอกอีกชั้นหนึ่ง โดยการใส่ ifame ของอีก Domain หนึ่งแทน

ifame
ifame

WordPress Upload รูปไม่ได้..

วันนี้นึกว่าเว็บจะใช้งานได้ตามปกติหลังจากย้ายโฮสมาแล้วซะอีก หลังจากแก้ไข Path ที่ผิดพลาดก็ดันไปเจอ Error อีกตัวหนึ่งครับ ทำให้ไม่สามารถที่จะ Upload รูปภาพขึ้นไปได้โดยใช้ Flash uploader ครับ มันจะฟ้อง Error พร้อมกับให้ปุ่ม Dismiss หากไม่สามารถใช้ Flash uploader ก็จะทำให้ความสะดวกในการทำงานลดลงไปมากเลยละครับ  สำหรับ Error ที่มันแจ้งขึ้นมาคือ

HTTP error.

An error occurred in the upload. Please try again later.

แหมม.. ขึ้นมาซะแดงแบบนี้เล่นเอาตกใจแย่เลยครับ สำหรับ Error ตัวนี้แก้ไม่ยากครับ ทำตามขั้นตอนดังต่อไปนี้เลยครับ

  1. Login FTP เพื่อดึงไฟล์ .htaccess กลับมาก่อนครับ
  2. จากนั้นเปิดไฟล์ขึ้นมาแล้วนำ Code นี้แทรกลงไปพร้อมกับ Upload กลับคืนไปทับไฟล์เก่าครับ

<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>

เพียงเท่านี้ก็จะสามารถใช้ Flash uploader ได้ตามปกติแล้วละครับ

Wordpress Error

ย้าย Host แล้ว WordPress Error

เนื่องจากเว็บไซต์ของผมเว็บนี้เมื่อก่อนนั้นอยู่โฮสนอก แต่ตอนนี้ได้ย้ายเข้ามาในโฮสไทย (โฮสพี่ต่อ tosakp ต้องขอขอบคุณพี่ต่อเป็นอย่าสูงที่รับฝากเว็บผม )  แต่หลังจากย้ายเข้ามาก็เจอปัญหามากมายในการย้ายโฮส Plugins Error บทความ Upload รูปภาพไม่ได้ WP Super Cache ไม่ทำงาน ฯลฯ แต่ปัญหาที่แก้ลำบากเล่นเอางงไปหลายวันคือไม่สามารถ Upload รูปภาพได้นี้ละครับ

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/.fabricating/sutenm/sutenm.com/wp-content/uploads/2009/05) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1737

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/home/.fabricating/sutenm/sutenm.com/wp-content/uploads/2009) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1746

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/.fabricating/sutenm/sutenm.com/wp-content/uploads/2009) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1737

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/home/.fabricating/sutenm/sutenm.com/wp-content/uploads) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1746

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/.fabricating/sutenm/sutenm.com/wp-content/uploads) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1737

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/home/.fabricating/sutenm/sutenm.com/wp-content) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1746

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/.fabricating/sutenm/sutenm.com/wp-content) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1737

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/home/.fabricating/sutenm/sutenm.com) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1746

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/.fabricating/sutenm/sutenm.com) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1737

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/home/.fabricating/sutenm) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1746

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/.fabricating/sutenm) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1737

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/home/.fabricating) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1746

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/.fabricating) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1737

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/home) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1746

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1737

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1746

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1737

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/www/virtual/sutenm.com/:/home/www/virtual/sutenm.com/phptmp/:/usr/share/php/) in /home/www/virtual/sutenm.com/htdocs/wp-includes/functions.php on line 1746

Unable to create directory /home/.fabricating/sutenm/sutenm.com/wp-content/uploads/2009/05. Is its parent directory writable by the server?
ขึ้น Error แบบนี้ ท่านใดที่เจอปัญหาแบบผม วันนี้ผมจะมาเสนอแนวทางการแก้ไขครับ ปัญหานี้เกิดจากสาเหตุ 2 สาเหตุครับ คือ Permission และ Path ผิดพลาด วิธีแก้คือ
  1. ปรับ Permission Directory uploads และ Directory ย่อยที่อยู่ใน uploads ให้เป็น 777
  2. Login เข้าไปที่ admin เข้าที่ Settings > Miscellaneous > ช่อง Store uploads in this folder แก้ไขเป็น “wp-content/uploads”

เพียงเท่านี้คุณก็จะสามารถ Upload ไฟล์รูปภาพได้ครับ

วิธีทำ Contact Us ใน WordPress

วันนี้ผมจะมาเสนอวิธีทำ Contact Us (ติดต่อเรา) อย่างง่ายใน  CMS อย่าง WordPress กับ Plugin ที่ชื่อ  Easy Contact นะครับ

ก็อย่างที่ผมอกไป คือมัน ง่าย.. แสนง่าย.. แต่ตัวผมนั่งจมเป็นเวลา 10 นาที เหอๆ ทำไมง่ายแต่ยาก เอ้ย ง่ายแต่ใช้เวลานาน ก็เพราะมันง่ายจนตัวกระป๋มเอง งงไงละครับ เอ้า.. ยิ่งเขียนยิ่ง งงตัวเอง ฮ่าๆ เอาเป็นว่าไปดูวิธีทำดีกว่าครับ

1. เข้าไปโหลด Plugin ที่ชื่อ Easy Contact ใน http://wordpress.org/extend/plugins/easy-contact/
2. อัป Plugin ตัวนี้ขึ้นไปในเว็บ แล้วเข้าไป Activate ครับ
3. เข้าไปจัดการ Form ได้ที่ Settings > Contact
4. สร้าง Page หรือ Posts ขึ้นมา จากนั้นนำ Code [easy-contact] ไปวางไว้

จบข่าว ง่ายๆ เลยครับ

Error Dreamweaver 8 “The following JavaScript error(s) occured”

 

ใครเปิดมาแล้วเป็นแบบนี้บ้างครับ (ขออ้างอิงข้อความของคุณ toto จากเว็บ twebmaster นะครับ)

เขียนเว็บด้วย DW8 มาได้ 2 อาทิตย์แล้วครับ แต่วันนี้(11 พ.ย.49)จู่ๆพอเปิด DW8 แล้วเกิดไคอนดังนี้ครับ (ลงรูปไมได้)
“The following JavaScript 
error(s) occured”
At line 56 of file “C:Program FilesMacroMedia
Dreamweaver 8ConfigurationSharedCommonScriptdwscriptsExtData.js”
ReferrenceError: dwscripts is not defined  ฮืม

พอเปิดเว็บที่เขียนไว้แล้วก็ขึ้นอีกว่า
“The following translators were not loaded due to errors:
ASP.htm: has configuration information that is invalid.
ColdFusion.htm: has configuration information that is invalid.
XSLT.htm: has configuration information that is invalid.”  อายจัง

หลังจากนั้นลองเอาเมาส์ไปพาดข้อความในหน้าที่กำลังทำงานเมื่อคลิกขวาเพื่อทำการก๊อปปี้จะมีไอคอนว่า
“While executing DWContext_Text_Cut command in minus.xml, the following Javascript 
error(s) occured:
TypeError: MM.event has no properties”   ลังเล

ยังไม่หมดนะครับ เมื่อทำการปรับปรุงเว็บไปเรื่อยๆ แล้วกด save ก็จะเจออีก 1 ไอคอน คือ
“While executing onload in tempURL_afterSave.htm, a Javascript 
error occured.”  โกรธ

มากมายขนาดนี้ลองลบใหม่แล้วลงใหม่และเปิดใหม่ก็ยังเป็นอยู่ดี วานผู้รู้ช่วยบอกวิธีแก้ไขด้วยครับ….!!!  ร้องไห้

 

พอดีผมเคยโพสวิธีแก้ไปนานแล้วมากๆ ในเว็บนั้นละครับแต่ตอนนี้ Link มันเสียไปแล้ว เอาเป็นว่าผมขอ Copy ตัวเองมาไว้ใน Blog ของผมเองนะครับ

วิธีการแก้ไขคือ

1. update version ของ Dreamweaver ล่าสุดของมันคือ 8.0.2 นะคับ ได้ในนี้เลยคับ http://download.macromedia.com/pub/dreamweaver/updates/dw_8/8_0_2/win/dw8_802_update_en.exe

2.  ทำการลบไฟล์ FileCache.dat ของ Dreamweaver ชื่อไฟล์คือ WinFileCache-7A9586CB.dat ตาม OS และเวอร์ชั่นที่ใช้เลยนะคับ

ต้องเปิดการซ่อนไฟล์ก่อนนะครับ

Dreamweaver CS3 on Windows Vista:

C:Users[username]AppDataRoamingAdobeDreamweaver 9Configuration

Dreamweaver CS3 on Windows XP:

C:Documents and Settings[username]Application DataAdobeDreamweaver 9Configuration

Dreamweaver 8 on Windows XP:

C:Documents and Settings[username]Application DataMacromediaDreamweaver 8Configuration

 

Dreamweaver 8 on Windows Vista:

C:Users[username]AppDataRoamingMacromediaDreamweaver 8Configuration

 

ลองแก้ตามนี้ดูละกันนะครับ

วิธีจัดการ 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