https://socksprem.blogspot.com/2016/08/auto-index-script.html