.htaccess / root directory คืออะไร?

.htaccess

.htaccess คือ  ค่า config ที่จัดการ website-access
มี Apache and LiteSpeed Support

แต่ nginx ไม่ซับพอต .htaccess แต่ถ้าจะย้ายไป nginx ก็มีคนทำ convert config ให้นะ

Root Directory

ทำความเข้าใจตรงกันก่อน
directory ถ้าพูดในแบบมือถือใหม่ก็คือ path ที่ folder อยู่
ดังนั้น root directory จะหมายถึง ตำแหน่งที่ตั้งต้นของ…..
ที่มีของ เพราะ ขึ้นอยู่กับบริบทคนพูด ว่า root directory ของเครื่อง, root directory ของ Angular, root directory ของ React

ดังนั้น ถ้าเราไปอ่านบทความไหน แล้วเค้าบอก root directory ให้ตีความตามเนื้อเรื่องที่อ่าน
ถ้ากำลังเกี่ยวกับ ubuntu, linux ก็หมายถึง root directory ของเครื่อง
ถ้ากำลังเขียนโปรแกรม ทำ project ก็หมายถึง root directory ของ project ที่ทำ งานที่ทำ

Reference

https://en.wikipedia.org/wiki/Talk%3A.htaccess
https://www.wikiwand.com/en/.htaccess
https://stackoverflow.com/questions/35766676/how-can-i-use-an-htaccess-file-in-nginx