htaccess question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • darnit
    Confirmed User
    • Jul 2001
    • 2439

    #1

    htaccess question

    Hi,

    This is probably a pretty stupid question for those technically minded. But here it goes.

    I have a folder of thumbs that I dont want to be available unless opened within an HTML page. Is there a way to modify my htaccess file so the thumbs can not be seen unless loaded within an .html file or opened directy by going to the .jpg directly?

    Thanks in advance.
  • aico
    Moo Moo Cow
    • Mar 2004
    • 14748

    #2
    just put a blank file in there and name it index.html

    Comment

    • darnit
      Confirmed User
      • Jul 2001
      • 2439

      #3
      Originally posted by aico
      just put a blank file in there and name it index.html
      Yes but that still wont stop those who access the .jpg file directly. Basically I dont want the file to load unless from a page. However I do have other graphics that need to load on the domain so im seeking a solution for a specific directory behavior regarding images.

      Comment

      • aico
        Moo Moo Cow
        • Mar 2004
        • 14748

        #4
        Originally posted by darnit
        ... so the thumbs can not be seen unless loaded within an .html file or opened directy by going to the .jpg directly?
        Sorry, I gave you the solution for what you asked...

        Comment

        • broke
          Confirmed User
          • Aug 2003
          • 4501

          #5
          RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ site.info.here [R,NC]
          Perfect Gonzo

          Comment

          • kernelpanic
            Too lazy to set a custom title
            • Jan 2005
            • 2961

            #6
            Are you looking to stop hotlinking, or type-ins of the jpeg? If your goal is to stop the latter, I urge you to reconsider. When someone "accesses it directly", no referer headers are sent to the server with the HTTP request.

            Why would this be problematic? Many surfers use privacy products, at browser, system, or firewall level that block the sending of HTTP referer headers. Thus, direct access would be indistinguishable from one of those "enhanced privacy" pieces of software.

            Why is direct access such a problem? If they can't browse the directory, and don't know image names, then how is it a problem?


            ZangoCash - Turn Your Traffic Into Ca$h.
            $.40 Per Install - No Tier

            Comment

            • darnit
              Confirmed User
              • Jul 2001
              • 2439

              #7
              Originally posted by kernelpanic
              Are you looking to stop hotlinking, or type-ins of the jpeg? If your goal is to stop the latter, I urge you to reconsider. When someone "accesses it directly", no referer headers are sent to the server with the HTTP request.

              Why would this be problematic? Many surfers use privacy products, at browser, system, or firewall level that block the sending of HTTP referer headers. Thus, direct access would be indistinguishable from one of those "enhanced privacy" pieces of software.

              Why is direct access such a problem? If they can't browse the directory, and don't know image names, then how is it a problem?
              Actually its because of 2257. I have ton of fake tgps that use remote thumbs. They have all been coverted to text links. I want to continue to use their listings however the program errors out if it cant upload thumbs to my server. So by disabling thumbs from being "available" to the web unless loaded in a page there is a reduced risk. Paranoid = yes.

              Comment

              • kernelpanic
                Too lazy to set a custom title
                • Jan 2005
                • 2961

                #8
                Originally posted by darnit
                Actually its because of 2257. I have ton of fake tgps that use remote thumbs. They have all been coverted to text links. I want to continue to use their listings however the program errors out if it cant upload thumbs to my server. So by disabling thumbs from being "available" to the web unless loaded in a page there is a reduced risk. Paranoid = yes.
                Ohh, so it is about remote linking then.


                You'll want to use mod_rewrite
                http://httpd.apache.org/docs/mod/mod_rewrite.html



                it will look something like this:
                Code:
                RewriteEngine On
                RewriteBase /
                RewriteCond %{HTTP_REFERER} !^http://www.pornosite.com [NC,OR]
                RewriteCond %{HTTP_REFERER} !^http://pornosite.com [NC]
                RewriteRule [^/]+.(jpg|jpeg|gif|png)$ - [NC,F,L]


                ZangoCash - Turn Your Traffic Into Ca$h.
                $.40 Per Install - No Tier

                Comment

                • darnit
                  Confirmed User
                  • Jul 2001
                  • 2439

                  #9
                  Just what i needed...

                  Thanks broke and kernel.... everyone please click on their sigs

                  Comment

                  Working...