August 17th, 2009

Apache FancyIndex with .htaccess

2 Comments », Linux, by nolifelover

index-stylelist


ห่างหายไปนานเลยกับการเขียนบล๊อกวันนี้มาอัพเดดหน่อย สำหรับตัวนี้จะเป็นการใช้งานของ apache IndexOptions ซึ่งจะเป็นการทำให้ folder เราสามารถ list ไฟล์ต่างๆ ได้เลย โดยการเขียนจะใช้งาน .htaccess เพื่อกำหนดค่าต่างๆ ครับ

วิธีการทำ
1. เริ่มแรกเลยไปยัง folder ที่ต้องการทำ index จากนั้นให้สร้างไฟล์ .htaccess แล้วเพิ่มโค้ดข้างล่างนี้

Options Indexes FollowSymLinks
IndexOptions FancyIndexing
IndexOptions VersionSort
IndexOptions HTMLTable
IndexOptions FoldersFirst
IndexOptions IconsAreLinks
IndexOptions IgnoreCase
IndexOptions SuppressDescription
IndexOptions SuppressHTMLPreamble
IndexOptions XHTML
IndexOptions IconWidth=16
IndexOptions IconHeight=16
IndexOptions NameWidth=*
IndexOrderDefault Descending Name
HeaderName /index-style/header.html
ReadmeName /index-style/footer.html

2. ให้ไปโหลดไฟล์ที่ http://recurser.com/articles/2008/12/29/styling-apache-directory-listings-with-mod_autoindex/ เพื่อทำให้สวยงามโดยการนำเอาไฟล์ไปไว้ที่ /index-style ก็จะได้รูปแบบสวยๆ แล้ว

เพิ่มเติม
http://recurser.com/articles/2008/12/29/styling-apache-directory-listings-with-mod_autoindex/

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

2 Responses to “Apache FancyIndex with .htaccess”

» You can leave a response or Trackback .

  1. Freedomlover Says:

    งามๆๆ

  2. nolifelover Says:

    อะแน่นอน

» Trackbacks/Pingbacks

Leave a Reply