.htaccess Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JimmyStephans
    Confirmed User
    • Mar 2003
    • 560

    #1

    .htaccess Help

    I have files (jpg. mp4, mp3) on one domain that I want to share with another domain, but not have them hotlinked to any other place.

    http://jimspics. com/files/testfile.mp3

    I want to put .htaccess in

    http://jimspics. com/files/

    To block hotlinks, but allow file to be pulled over to

    http://truebabes. com/

    Thoughts, samples, suggestions?

    Thanks
    http://TrueBabes.com/
  • SplatterMaster
    Confirmed User
    • Jan 2012
    • 790

    #2
    See next post

    Comment

    • SplatterMaster
      Confirmed User
      • Jan 2012
      • 790

      #3
      And here is a htacess generator for ya Click on the Disable Hotlinking tab and generate away

      .HTACCESS IP, Referrer, and Hotlink Banning Generator

      Comment

      • JimmyStephans
        Confirmed User
        • Mar 2003
        • 560

        #4
        I did try that, and couple of others discussed there, but no luck yet.

        Thanks
        http://TrueBabes.com/

        Comment

        • Jel
          Confirmed User
          • Feb 2007
          • 6904

          #5
          master domain root:

          Code:
          RewriteEngine on 
          RewriteCond %{HTTP_REFERER} !^$
          RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain1.com.*$ [NC]
          RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain1.com:80.*$ [NC]
          RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain2.com.*$ [NC]
          RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain2.com:80.*$ [NC]
          
          RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ http://www.originaldomain/hotlinkimagefolder/hotlinkimage.jpg
          then this in your http://www.originaldomain/hotlinkimagefolder/ to allow the hotlinked image:

          Code:
          RewriteEngine on 
          RewriteRule ^.*$ -
          not sure on the 'gospel' code, but had that on a domain for years, to do exactly what you want, with zero problems. May need tidying up to be how a pro coder would do it, and tweaking for extensions other than jpg/gif, but that will get you up and running for now

          Comment

          • Jel
            Confirmed User
            • Feb 2007
            • 6904

            #6
            sorry, just seen you have movie files too. I can't remember which domains I have that in place, but will have a look tomorrow if no-one has been able to give you the fix. 1am here and I gotta hit the sack before I drop

            Comment

            • JimmyStephans
              Confirmed User
              • Mar 2003
              • 560

              #7
              Acording to this site it should work.

              .HTACCESS IP, Referrer, and Hotlink Banning Generator

              But, doesn't. Frustrating.
              http://TrueBabes.com/

              Comment

              • JimmyStephans
                Confirmed User
                • Mar 2003
                • 560

                #8
                Originally posted by Jel
                sorry, just seen you have movie files too. I can't remember which domains I have that in place, but will have a look tomorrow if no-one has been able to give you the fix. 1am here and I gotta hit the sack before I drop
                Thanks, look forward to what you find.
                http://TrueBabes.com/

                Comment

                • SplatterMaster
                  Confirmed User
                  • Jan 2012
                  • 790

                  #9
                  Noticed you're on HG. Did you try this?

                  What is hot linking? How do I enable and disable hotlink protection? « HostGator.com Support Portal

                  Comment

                  • Jel
                    Confirmed User
                    • Feb 2007
                    • 6904

                    #10
                    back.. ok sorry mate I was tired and not quite with it - now I've got a clearer head, from memory you can't prevent hotlinking movie files unless you do some tech shit that I have zero idea about. The other thing I was thinking of was related to redirecting image hotlinking by google's image search to a specific html page (instead of just showing your hotlink image), rather than preventing hotlinking of movies. Sorry for the confusion.

                    It can be done, but way above my head, hopefully others can chime in.

                    Comment

                    • JimmyStephans
                      Confirmed User
                      • Mar 2003
                      • 560

                      #11
                      Ah, ok then. Thanks for the help. That answers my main question.
                      http://TrueBabes.com/

                      Comment

                      • JimmyStephans
                        Confirmed User
                        • Mar 2003
                        • 560

                        #12
                        Originally posted by SplatterMaster
                        Thanks - but it didn't work for the mp4 files, now I see that its common to not work on movies files, so of I go looking for another solution.
                        http://TrueBabes.com/

                        Comment

                        • SplatterMaster
                          Confirmed User
                          • Jan 2012
                          • 790

                          #13
                          How bout just limiting the entire directory to a referer?

                          Something like this

                          Use .htaccess to allow access only from a single HTTP referrer

                          Comment

                          • jimmycastor
                            So Fucking Banned
                            • Jul 2006
                            • 342

                            #14
                            maybe your .htaccess isnt active, check apache settings

                            Comment

                            • JimmyStephans
                              Confirmed User
                              • Mar 2003
                              • 560

                              #15
                              Thanks guys. That link is interesting, and going to try that now.

                              And yes, htaccess is active (its working fine for normal password protected areas and all.

                              Just trying to block linking of .mp4 videos
                              http://TrueBabes.com/

                              Comment

                              • Barry-xlovecam
                                It's 42
                                • Jun 2010
                                • 18083

                                #16
                                Htaccess - THE Ultimate .htaccess

                                Code:
                                RewriteCond %{HTTP_REFERER} !^$
                                RewriteCond %{HTTP_REFERER} !^http://(www\.)?askapache\.com/.*$ [NC]
                                RewriteRule \.(gif|jpg|swf|flv|png)$ http://www.askapache.com/feed.gif [R=302,L]
                                **opps*** you may have a MIME type issue? MPEG-4 Part 14 - Wikipedia, the free encyclopedia

                                This format is right but you will have to set paths and file types -- he missed JPG and jpeg JPEG if necessary? -- Apache is case sensitive if that has something to do with the pathing problem. Also, any space must be escaped %20... The UNIX rule for naming conventions should be followed if you don't want grief (been there done that before).

                                If the access is to be restricted in a certain directory, try putting the .htaccess in that directory. Apache reads the .htaccess in each directory in the path to the file's location when it will GET the file.

                                Comment

                                • fris
                                  Too lazy to set a custom title
                                  • Aug 2002
                                  • 55679

                                  #17
                                  Originally posted by JimmyStephans
                                  Thanks guys. That link is interesting, and going to try that now.

                                  And yes, htaccess is active (its working fine for normal password protected areas and all.

                                  Just trying to block linking of .mp4 videos
                                  tricky with video hotlinking, since refers are always not sent.

                                  i make my urls expire so they cant be shared
                                  Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

                                  Comment

                                  Working...