• Creator
  • #2211633

    How can I protect the contents of my website?


    by padam123 ·

    I am developing a dynamic website as a part of my study.

    I have organized the contents in different folders such images, photos etc. But when i type the full path of the image or any other file in the address bar it opens.

    But I don’t want so specially for images. But those images should appear in the web pages.

    Is there some technique to prevent the images to display?

All Answers

  • Author
    • #3027794


      by padam123 ·

      In reply to How can I protect the contents of my website?


    • #3027791

      If I understand your question correctly

      by oh smeg ·

      In reply to How can I protect the contents of my website?

      Then there is no way to prevent the Image opening if you type in the Full Address of it in a Web Browser.

      The thing here is that others viewing the Web Page will never see the Sub Folders of Files & Images or anything else that you hide in that Web Site so they will not know that it is there and if you don’t post directions to reach these files/folders they will not be able to access them directly.

      By typing in the full address of a File/of any type the Web Browser takes you to that address.

      However there are other ways of setting up Web Hosting Services and making certain parts of the Entire Web Site Private. That however is down to the Hosting Software not the Web Page itself. 😉

      I’m no expert in Web Design though and maybe some others here at TR who specialize in this work can give you pointers in other way of doing things.


    • #3029818

      No simple solution

      by nvrtis ·

      In reply to How can I protect the contents of my website?

      A web server cannot tell the difference between a request for a file from a link (img or href) and a request typed into the address bar of the browser.

      You can protect the whole site or individual directories (look up htaccess) with a password. But then all site visitors will need to enter the password.


    • #3029813

      make a .htaccess file

      by slayer_ ·

      In reply to How can I protect the contents of my website?

      You might need to use DOS to make this file as Windows won’t let you make a file starting with a .

      Click Start
      Type cmd
      in the command prompt, type

      CD C:
      edit C:\.htaccess

      This should open up a blue editor. Enter this text.

      RewriteEngine on
      RewriteCond %{HTTP_REFERER} !^http://(www\.)?*$ [NC]
      RewriteRule .*\.(gif|jpg|jpeg|bmp|png)$ [R,NC]

      Since that is hard to read, I also put it in a txt file for you.

      This may work, I am not certain

      • #3027281

        Thank you

        by padam123 ·

        In reply to make a .htaccess file

        Thank you all for your useful answers.

        It’s been a great pleasure to have experts out there.

        I will be asking a lot of questions in this forum as i am pretty much interested in PHP and MySQL

        Thank you ala again

Viewing 3 reply threads