Using htaccess, how to restrict seeing directory contents, but allow server to use the contents?

后端 未结 11 1939
既然无缘
既然无缘 2021-01-30 22:38

More specifically, I have an htaccess file that restricts anyone from seeing the directory contents. Such that, nobody can see my 1000s of images in www.example.com/images by us

11条回答
  •  死守一世寂寞
    2021-01-30 23:40

    To me I feel the easiest way of getting it done is with a redirect. On the images directory, just create an index page and in the index page you have a redirect to your site index page i.e

    
    

    So that whenever anyone tries to access the image page directly they end up going to your site's root.

提交回复
热议问题