GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   .htaccess Help (https://gfy.com/showthread.php?t=1155553)

JimmyStephans 11-27-2014 04:49 PM

.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

SplatterMaster 11-27-2014 05:31 PM

See next post :)

SplatterMaster 11-27-2014 05:39 PM

And here is a htacess generator for ya :) Click on the Disable Hotlinking tab and generate away :thumbsup

.HTACCESS IP, Referrer, and Hotlink Banning Generator

JimmyStephans 11-27-2014 05:50 PM

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

Thanks

Jel 11-27-2014 06:08 PM

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 :thumbsup

Jel 11-27-2014 06:09 PM

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 :)

JimmyStephans 11-27-2014 06:14 PM

Acording to this site it should work.

.HTACCESS IP, Referrer, and Hotlink Banning Generator

But, doesn't. Frustrating.

JimmyStephans 11-27-2014 06:15 PM

Quote:

Originally Posted by Jel (Post 20304343)
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.

SplatterMaster 11-27-2014 08:50 PM

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

Jel 11-28-2014 09:36 AM

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.

JimmyStephans 11-28-2014 12:23 PM

Ah, ok then. Thanks for the help. That answers my main question.

JimmyStephans 11-28-2014 12:24 PM

Quote:

Originally Posted by SplatterMaster (Post 20304447)

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.

SplatterMaster 11-28-2014 04:32 PM

How bout just limiting the entire directory to a referer?

Something like this

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

jimmycastor 11-28-2014 06:42 PM

maybe your .htaccess isnt active, check apache settings

JimmyStephans 11-28-2014 08:12 PM

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

Barry-xlovecam 11-28-2014 10:19 PM

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.

fris 12-02-2014 02:00 AM

Quote:

Originally Posted by JimmyStephans (Post 20305641)
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


All times are GMT -7. The time now is 07:13 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc