0

I have a folder named Pictures under my domain (mydomain.com/pictures). I use these pictures on certain pages like with tags like:

<img src="pictures/image.jpg" alt="img" />

Now can I somehow prevent these pictures from being reached directly? I dont want to be able to access the picture by typing "mydomain.com/pictures/image.jpg" in the addressbar. I only want them accessed when called from server tags like the one above.

I am using IIS server and PHP scripting language.I have read ASP Hack

TylerH
  • 20,799
  • 66
  • 75
  • 101
user1885057
  • 85
  • 1
  • 2
  • 12
  • Perhaps read [this](http://stackoverflow.com/questions/10236717/htaccess-how-to-prevent-a-file-from-direct-url-access) and translate the htaccess rules to IIS using [this](https://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/translate-htaccess-content-to-iis-webconfig) – samgak Oct 06 '16 at 09:06
  • Yes I did, most of them are using apache server using htaccess, but as I have mentioned I am on IIS it won't help. – user1885057 Oct 06 '16 at 09:06
  • Adjust your title to reflect it – RST Oct 06 '16 at 09:07
  • 2
    Possible duplicate of [How to protect against direct access to images?](http://stackoverflow.com/questions/3990337/how-to-protect-against-direct-access-to-images) – Max Zuber Oct 06 '16 at 09:08
  • @RST I have changed question title.You can tags btw – user1885057 Oct 06 '16 at 09:08
  • I know, but it makes it more obvious what you are looking for when people have a list of topics on their screen. http://stackoverflow.com/questions/34313670/prevent-direct-access-to-files-on-iis-server – RST Oct 06 '16 at 09:09
  • @MaxZuber different platforms. – user1885057 Oct 06 '16 at 09:10
  • @user1885057 It doesn't matter, it's just a clue. – Max Zuber Oct 06 '16 at 09:15
  • @MaxZuber the link share is irrelevant. i want to images from direct url. – user1885057 Oct 06 '16 at 09:27

0 Answers0