มาสนุกแบบมีประโยชน์กับ Htaccess ไฟล์ .htaccess มีประโยชน์มากมายแต่น้อยคนนักจะรู้ถึงประโยชน์และความสนุกของมัน

สิ่งแรกที่ควรคำนึง

htaccess จะใช้ได้กับ โฮส ที่ใช้ apache เป็น webservergเท่านั้น ส่วน host colorpack.netสามารถใช้ได้อยู่แล้ว

1. ใช้ htaccess ป้องกันการ การดูดไฟล์โดยตรง

เช่นเรามีรูป อยู่ในเว็บเราเช่น http://www.colorpack.net/images/stories/logo.png แบบนี้เว็บไหนก็สามารถดึงรูปไปใช้ได้ โดยเมื่อคนมาเปิดรูปก็จะมาเรียกเอารูปที่เว็บเราทำให้เปลือง Data Tranfer วิธีป้องกัน


RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?demo.collegeaintcheap.com [NC]

#show no image when hotlinked
RewriteRule \.(jpg|png|gif)$ - [NC,F,L]


2. Block User โดยใช้ IP Address


Order Deny,Allow   
Deny from 24.121.202.23
# Deny from 0.0.0.0


Deny =  ปฏิเสธ     Allow = อนุญาต การ


การเขียนด้านนหมายถึง  ปฏิเสธ ip 24.121.202.23 ไม่ให้เข้าเว็บ




 

The Joomla! logo is a trademark of Open Source Matters, Inc, in New York, NY.
  Colorpack.net is not affiliated with or endorsed by Open Source Matters or the Joomla! Project

Valid XHTML 1.0 Transitional
Clicky Web Analytics Blog Search Engine
Fashion Mall : เปิดร้านขายของ เสื้อผ้า online ฟรี data recovery service data recovery Ajax โปรโมตเว็บ Opensource News CSS Layouts, css templates, news, xhtml templates, css iphone ipad Beauty Fashion worldwide travel guide insurance structured settlements