วิธีการเรียงลำดับการเปิดไฟล์ index สำหรับ server linux

คุณสามารถจัดเรียงลำดับ file index ของคุณได้เองว่าต้องการให้ index อะไรขึ้นก่อน-หลัง
วิธีการดังต่อไปนี้

1.ให้สร้างไฟล์ .htaccess
2. ข้างในมี code ตามข้างล่าง เรียงลำดับชื่อ file index ตามต้องการให้มา ก่อน-หลัง

DirectoryIndex index.htm index.html index.php index.cgi index.pl

3. จากนั้น upload ไฟล์ ไปไว้ใน httpdocs ค่ะ
4. ทดสอบการเรียน file ผ่านทางหน้าเว็บค่ะ

ดังนั้นจากตัวอย่าง ลำดับของ file index ที่จะแสดงก็จะเป็นดังนี้
file index.htm จะถูกเรียกขึ้นมาเป็น fileแรก
ถ้าไม่มีก็จะเรียกลำดับต่อๆไปค่ะ
index.html
index.php
index.cgi
index.pl
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

ใช้ Firefox เข้า Plesk Control Panel แล้ว Error : Issuer certificate is invalid (Error code: sec_error_ca_cert_invalid)

ใช้ Firefox เข้า Plesk Control Panel แล้ว Error : Issuer certificate is invalid (Error code:...

วิธีการเปลี่ยน permission ของ folder หรือ file ที่เป็น plesk windows

วิธีการเปลี่ยน permission ของ folder หรือ file ที่เป็น plesk windows 1. Login เข้าที่ระบบ...

เซิร์ฟเวอร์ของ ไชโย โฮสติ้ง ตั้งอยู่ที่ไหน

Data Center ตั้งอยู่ ที่ ISSP และ Pacific Internet ตึกการสื่อสารแห่งประเทศไทย...

ทำไมเข้าเว็ปอื่นได้ปกติ แต่บางเว็ปเข้าไม่ได้

อาจจะเกิดจากค่า dns ของผู้ให้บริการ Internet ที่ใช้บริการอยู่ไม่ update...

ถ้าต้องการให้ Register_Globals on จะต้องทำอย่างไรบ้าง

คุณสามารถทำได้โดย 1. สร้างไฟล์ .htaccess 2. โดยในไฟล์จะต้องมีข้อความดังต่อไปนี้ php_flag...