![]() |
Referral URL
I'm hosting some files on some space and I only want that file to be downloaded if it's being referred from a page.
reason is that i dont want people hotlinking that file. is this easy to do? |
If it's being hosted on a unix machine, you can use apache's mod_rewrite to put some directives in your .htaccess file. Here's a generator for making a .htaccess file that blocks hotlinking.
http://www.htmlbasix.com/disablehotlinking.shtml If it's windows and IIS, I don't know how to do it, but I know it'll be a bit tougher. |
i'm not that advanced.
i use frontpage to make the site and the site is hosted on a provider for me. i just upload the files from frontpage. |
Dude,
Is your hosting on linux or MS? When you ftp in, do you start in a home directory like / or /www? When you log on via ftp, the prompt box should scroll through some things after password is accepted. Amongst this is usually some idication of the system OS. Unix systems us a file called .httaccess that's invisable in the main directory (that / or /www). You won't see it in your ftp window but it's there. There are great tutorials on .htaccess on the net that will show you how to add one line to the file that will do exactly this. you can create a file called htaccess.txt, add the code you want to it, then upload it and rename it to .htaccess via ftp. Here's a semi-fictional example from my site of what the file should look like: Code:
.htaccess adding lines of code into this will tell the system whom to allow access to. You can define it by IP address or referer. |
it is hosted on linux and i'll do the renaming part.
btw, my site is also hosted on 1and1.com :D |
Bingo,
did a little digging through my refrences and found some lines that fit your need perfectly! LINK Read the tutorial, change the variables to your domain and the file extensions you need, and add those lines of code (but leave the empty line between .htaccess and the other lines!) Good luck:p Post back if you need more help. Edit: You can also use this for non-apache linux servers (i don't know what 1and1 is using) Code:
RewriteEngine on Quote:
|
All times are GMT -8. The time now is 12:01 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project