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

后端 未结 11 1823
既然无缘
既然无缘 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:43

    I use a trick which makes people think they've accessed a folder which doesn't exist.

    Create a HTML file and add this:

    
    
    
    404 Not Found
    
    
    
    

    Not Found

    The requested URL was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

提交回复
热议问题