what does this mean?
this will prevent other users from hotlinking your images/ graphics/ songs/ video/ ect.. but, will ALLOW only your profile to hotlink.

why do this?
this will not only save your bandwidth but will also help prevent rookie profile thieves who copy & paste entire layouts.

what do I need to do this?
you will NEED to have your own web host, this will NOT work for free file hosting sites such as ripway.com, photobucket.com, filelodge.com, ect.. you will end up having to pay for a host for this to work :/ but if you already have a website, bam! keep reading..

blah blah.. i know my shiz, how do I do this!?
it’s actually super simple (although it took me a little while to perfect). all you have to do is copy the code and paste it into the .htaccess file that is in the directory(folder) that you want to prevent others from hotlinking..

for example: say you have a directory named “layout01″ that contains all the graphics used in your layout. create (or edit and existing) .htaccess file in “layout01″. now add this code to it & save:

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://.*$
RewriteCond %{HTTP_REFERER} !^http://([-a-z0-9]+\.)?myspace\.com/.*=YOUR_FRIEND_ID(\D.*)? [NC]
RewriteCond %{HTTP_REFERER} !^http://([-a-z0-9]+\.)?myspace\.com/YOUR_MYSPACE_URL [NC]
RewriteRule \.(gif|jpe?g|png|swf|mp3)$ - [F,NC,L]

-Make sure you replace the yellow text with your info!
-Also, this is ONLY 5 lines of code.
- bigups to Eric for helping me clean things up!

The above will successfully prevent hotlinking but still permit direct access to the file.. To get even more strict and ONLY give your myspace profile access to the file, remove the line of code in orange.

i really don’t know how to go into much more detail, but if many of you have problems with this.. i may go a wee bit more in depth.

To see results or test if it’s working, clear your cache then refresh the page that’s NOT supposed to be allowed to hotlink.

oh yeah, a HUGE thanks to Tom Sherman over at underscorebleach.net for his original tutorial on selective hotlinking.

12 Responses to “Allow ONLY your Myspace Profile to hotlink.”

  1. i cant get this to work. :/

  2. wow

  3. Can I do this with the whole profile or just the pics and such? In other words, can I copy the whole source of my profile, place it on another server, then call it from there?

  4. i can’t seem to get this to work either… still hotlinks when adding pics ect on another account other than man own profile.

  5. okay… it works now but, no one can view my images?

  6. I love you~

  7. a warning. when you use the .* before and after your friend id, it might not block all other myspace profiles. for instance, if my fid is 2489, since i use a .* technically, fid 2248967 could still access my stuff. the solution to that could be to add an = right before and after add a non-digit modifier or an &.

    RewriteCond %{HTTP_REFERER} !^http://([-a-z0-9]+\.)?myspace\.com/.*=YOUR_FRIEND_ID(\D.*)? [NC]

    i dunno, not exactly probable, but still good measure.

    Additionally, some firewalls return http requests as something like “Blocked by personal firewall.”, so they will be blocked as well. Another rewrite condition that could be used is:

    RewriteCond %{HTTP_REFERER} ^http://.*$

    which checks that the referrer header does actually contain another website’s URL.

  8. okay… it works now but, no one can view my images?

    yup, as long as the images are on YOUR profile, everyone can see them.

  9. Eric.. so awesome.

  10. How would you use this if possible for your own myspace group?

  11. kool

  12. Putting RewriteCond %{HTTP_REFERER} !^http://([-a-z0-9]+\.)?myspace\.com/.*=YOUR_FRIEND_ID

    This isn’t working, it gives you or your friend a login error saying “too many attempts to log in” and you have to enter a picture verification? It swamped my email login to the point where it thinks your a spammer????

Trackbacks/Pingbacks

Leave a Reply