Restricts directory indexes and redirects accordingly.