Forum Moderators: phranque

Message Too Old, No Replies

disable hotlinking without .htaccess?

I could use some specific help...

         

harmanl

7:01 pm on Nov 3, 2003 (gmt 0)

10+ Year Member



==============

Hi, I'm new here. I'm having a lot of trouble with people hotlinking my images and using up my bandwidth. I have a "Tripod Pro" account which, unfortunately, does not have any way to disable filesharing, and does not allow me to mess with my .htaccess file.
I read this suggestion by CrazyFool, but I'm not very experienced in this stuff, and I wonder if someone could tell me more specifically where I can put my image files to keep folks from hotlinking them.
My homepage is <snip> Then I have subfolders for my 2 sites, "alice" and "halloween" with image folders under these.
Any help would be greatly appreciated.
Thanks and here's CrazyFool's suggestion below:

<quote>
there is an easier way to avoid hotlinking without using .htaccess files.
your domain name will normally be mapped to a directory (/web or /htdocs or something like that) within your hosting account, and you will normally place images in a subdirectory of this, ie, /web/images/. you will link to the images with <img src="images/filename.jpg" ...

create an images directory at the same level as your /web or /htdocs directory. change your image links to <img src="../images/filename.jpg .... etc. there is no direct web access to this directory so nobody can hotlink. only your web pages and scripts can access the images directory. voila! no more hotlinking and no .htaccess files!

you should do the same with any sensitive files or information that you want to prevent access to.
</quote>

[edited by: engine at 8:31 pm (utc) on Nov. 3, 2003]
[edit reason] No urls, thanks. See TOS [webmasterworld.com] [/edit]

jdMorgan

8:03 pm on Nov 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



harmanl,

Welcome to WebmasterWorld [webmasterworld.com]!

Rather than trying to find some magic way to prevent hot-linking, I'd suggest you consider a 'serious' web-hosting service. For a very reasonable monthly fee, you can set up one account and host as many sites under that one account as you like - not 1000, but say 25 small sites or so.

Then, you won't have to put up with hotlinking, pop-up advertising, no site stats, no raw logs, and all the other shortcomings and silliness of free and very-cheap hosting.

A link on the Web is a link on the Web. There's no way to 'hide' files by putting them in a special folder. You'll need .htaccess with mod_access and/or mod_rewrite on Apache servers, or ISAPI filters for Windoze servers.

Jim

P.S. Please read the WebmasterWorld Terms of Service; In order to encourage high-quality content, we try not to post personal URLs here in the forums. Thanks!

harmanl

9:05 pm on Nov 3, 2003 (gmt 0)

10+ Year Member



Hi Jim,
I had a feeling someone would suggest that I get a "real" host, tee-hee. I think I will sometime. I just get confused about which would be the best host.
Sorry about posting the link, I didn't mean to try to advertise my site. I get too much traffic as it is, that's part of my original problem :)
Thank you very much for your response. I couldn't quite make sense of the "hiding files" idea, so it's interesting to know that it probably wouldn't work anyway.
Thanks again,
Lauren

Michael Anthony

9:10 pm on Nov 3, 2003 (gmt 0)



I've got the same problem with a .co.uk domain hosted in the UK. Anyone care to recommend one via sticky mail?

jdMorgan

11:22 pm on Nov 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are quite a few sites out there that offer Web hosting comparison shopping.

If you come down to just a few candidates (2 or 3), sign up for a month only with each of them, and upload a "hobby site". Change your dns over to point to it, tweak it a bit, try some complex .htaccess tricks, and call and e-mail their customer service a couple of times... Nothing like a test drive... :)

I like several "old fuddy-duddy" name-brand hosting companies. Not the latest, not the cheapest, but I know they'll be there tomorrow! Be on the lookout for "companies" that exist only as resellers of other companies' hosting capacity - you can often do better cutting out the middle-man if there is no value-added.

As far as what to look for, you can tell a lot by asking if you'll have access to all Apache core directives, plus mod_access, mod_actions, mod_alias, mod_asis, mod_auth, mod_autoindex, mod_cgi, mod_dir, mod_headers, mod_include, mod_mime, mod_mime_magic, mod_rewrite, mod_setenvif, mod_usertrack, and maybe some I forgot...
You must also have an AllowOverride All setting for your account. Make sure you will have access to your raw access logs and raw error logs, as well as any stats package you may want. Lacking *any* of that, your host will just "get in your way."

Make sure your account will allow you sufficient disk space and bandwidth to serve your site(s).

Then you may want to consider how seriously they take reliability. It's good to have UPS (Uniterruptable Power Supplies) at a rack, room, or even building level, multiple backbone connections in case a cable gets cut, and a 24x7 help desk that has no trouble understanding your problem report. I like it when their attitude is one of, "Well, we'll go offline in case of a direct new-clear attack on our area... Other than that, no."

You can get all that for $15 U.S. -- or less -- per month.

Jim

Michael Anthony

7:25 am on Nov 4, 2003 (gmt 0)



Thanks jdmorgan, that's great advice. Looks like it's time for me to go host shopping!

Solution1

4:38 pm on Nov 5, 2003 (gmt 0)

10+ Year Member Top Contributors Of The Month



I'm not sure if you've already thought of this, but you could of course change the directory where your images reside every once in a while. Or you could change the filenames.

To request people who hotlinked to not to, you might put a few images in the place of the old ones, that contain a text with a request not to hotlink.