Home > Linux, Web > Simple way to disable direcotry index in webserver

Simple way to disable direcotry index in webserver

March 14th, 2009

This script will disable webserver’s directory index for currect directory and all subdirectories.

IFS=$'\n'
for i in $( find . -type d); do
    if [[ ! -f "$i/index.html" && ! -f "$i/index.php" ]]; then
        touch "$i/index.html"
    fi
done
Bookmark and Share  
 

Yejun Linux, Web , ,

  1. No comments yet.
  1. No trackbacks yet.