1

Please help me to avoid direct access when we enter the path to file/image..

3 Answers3

5

Put your image outside web folder and serve it with php.

egis
  • 1,404
  • 2
  • 11
  • 24
0

You can set Directory listing to false for the folder you want to protect from direct access. In your hosting panel there is a option to set this Parameter.

Abhishek
  • 101
  • 1
  • 3
0

If you are using cPanel, use "Hotlink Protection". Hotlink protection prevents other websites from directly linking to files on your website. You can block direct access by specifying extensions. You can add jpg, png, gif,etc. for this problem.

Here is the tutorial.

https://www.cpanel.net/media/tutorials/hotlink_lo.htm

Mansoorkhan Cherupuzha
  • 1,761
  • 1
  • 24
  • 45