Forum Moderators: phranque
finally i have found this forum that can help me with my problem. well i have a small website from where i sell stuffs to keep the site online... but now i have a big problem... as the site get older, more search engine starts to show my download section which let visitors directly jump to my download page and download the file without even viewing the main page... so what i want to do is force all the people who don't come from my domain or my friendly domain... and want to force user directly view my download page..... for example:
my domain is http://example.com
my download php is at http://example.com/pafiledb/index.php
so i want to force people who directly jump to http://example.com/pafiledb/index.php without viewing the http://example.com/index.html
this cause my a big problem and lose too as they eat my bandwidth and without looking at my products. so please help me or i will have to close my site because i cannot buy extra bandwidth every month... yes i have to buy extra bandwidth last 2 month... so this is enough... either i have to stop them or i will have to close the site.... i hope i will get all the help i need on this site....
thanks.....
[edited by: jdMorgan at 6:44 pm (utc) on June 30, 2007]
[edit reason] No URLs, please. See Terms of Service. [/edit]
This is basically the same thing as a "hotlinking" problem, and can be solved with the same methods. In fact, an "anti-hotlinking" feature is often included in shared Web hosting "Control Panels". Despite the fact that control panels write awful code, it usually works...
Please start with a search here for "block hotlinking Apache [google.com]" and then post specific questions here in this thread.
Jim
[mysite.com...]
thats how they jump to my download page without even viewing the main page... so i want to force everyone to come from main page... will hot linking code will do that for me? please let me know...
please tell me what this below code do..
-------------------------------------------------
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://(www\.)?myssite\.com [NC]
RewriteCond %{HTTP_REFERER}!^http://192\.168\.0\.1
RewriteRule \.(gif¦jpg)$ - [NC,F]
-------------------------------------------------
RewriteEngine on
# If HTTP_REFERER is not blank
RewriteCond %{HTTP_REFERER} .
# And if referrer is not "www.mysite.com/" or "mysite.com/index.html", etc.
RewriteCond %{HTTP_REFERER} !^http://(www\.)?myssite\.com/(index\.html)?$ [NC]
# Then redirect the download page request to www.mysite.com/index.html
RewriteRule ^padbdownload/(index\.php)?$ http://www.mysite.com/index.html [R=301,L]
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim