วิธีการ จำกัด การเข้าถึง IP ไปยังไดเรกทอรี Apache โดยใช้ไฟล์. htaccess?

หากคุณมีเส้นทางที่มีข้อมูลสำคัญซึ่งคุณไม่ต้องการเป็นแบบสาธารณะคุณสามารถ จำกัด เส้นทางโดยใช้ที่อยู่ IP ของคุณโดยใช้ไฟล์. htaccess

สร้างไฟล์. htaccess ในเส้นทางที่คุณต้องการปกป้อง เพิ่มรหัสนี้ที่คุณต้องการแทนที่ 1.2.3.4 ด้วย IP ของคุณเอง

<Limit GET POST>
       order deny,allow
       deny from all
       allow from 1.2.3.4
</Limit>
<Limit PUT DELETE>
       order deny,allow
       deny from all
</Limit>

 

บทความจาก How to restrict IP access to an Apache directory using an .htaccess file?

https://help.directadmin.com/item.php?id=504

  • htaccess
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

วิธีเขียนโค้ด php ใน ไฟล์นามสกุล html

อยากเขียนโค้ด php ใน ไฟล์นามสกุล html ทำได้โดย .htaccess ความรู้เก่า   <IfModule...

การทำ Redirect from HTTPS เป็น HTTP

There are some specific cases when you want to redirect particular URL or a single website to be...

จะทำการ block IP โดยใช้ .htaccess ได้อย่างไร

สามารถทำได้โดยระบุ IP ที่ต้องการบลอกที่ .htaccess ไฟล์ โดเยการสร้างไฟล์วางไว้ที่ public_html...

วิธีการเปลี่ยนหน้าแรกจากไฟล์ index เป็นชื่ออื่นที่ต้องการใน hosting ของเรา

ภายในไฟล์ .htacess ให้ระบุข้อมูลต่อไปนี้ครับ DirectoryIndex ชื่อไฟล1 ชื่อไฟล์2 ชื่อไฟล์3...

Leverage browser caching

Change the request headers of your resources to use caching. Optimize your caching strategy....