View Full Version : ok heres something about hotlinking...
see if anyone can help me out.
I used the hotlinking function in cpanel to hotlink my sites to prevent other sites leeching my bandwidth(due to linking of pictures etc)...
its working finely... but strangely enough after i hotlink the whole site... it somehow affected my WAP site, my users can no longer download wallpapers, ringtones from the WAP site... just hung there... by right it shouldn't be this way...
I try asking help in cpanel forum but no replies for quite sometime... :(
salmonella
03-09-2003, 12:13
That probably makes use of the HTTP "Referer" header. WAP browsers may not support this feature... or it may disable the feature by default in order to conserve bandwidth.
Originally posted by salmonella
That probably makes use of the HTTP "Referer" header. WAP browsers may not support this feature... or it may disable the feature by default in order to conserve bandwidth.
hmm anywhere to go ard about this?
salmonella
03-09-2003, 13:52
a) enable hotlinking for your WAP site
b) allow blank referer or no referer header
c) ask all your wap users to configure their browser to add the referer header.
for a and b, refer to your apache documentation.
You can write a script to check the USER-AGENT before doing a referer check. This will ensure WAP users are directed to the intended page and the rest will go through the referer check.
Originally posted by alien
You can write a script to check the USER-AGENT before doing a referer check. This will ensure WAP users are directed to the intended page and the rest will go through the referer check.
pardon me but this script is done in the wml scripts?
Originally posted by salmonella
a) enable hotlinking for your WAP site
b) allow blank referer or no referer header
c) ask all your wap users to configure their browser to add the referer header.
for a and b, refer to your apache documentation.
ermm what if they are not using WAP browsers but just their mobile phone?
Originally posted by localhost
pardon me but this script is done in the wml scripts?
You can use any scripting language like PHP to do the USER-AGENT checking, before sending the WML tags/contents. Something like this..
<?
if ($HTTP_USER_AGENT != "Some mobile phone User Agent") {
// do other checking
}
// otherwise just display the WML content
header("Content-type: text/wml");
?>
<wml>
<card id="abc" title="123">
...
</card>
</wml>
salmonella
03-09-2003, 19:05
I don't know the next thing about WAP orWML, but... even mobile phones use a built-in browser when browsing WAP sites, right?
I'm not sure whether it's feasible to base this on the user agent; what if your users are in japan, where there are literally thousands of phone models, each of which (might) have a different user agent?
Originally posted by alien
You can use any scripting language like PHP to do the USER-AGENT checking, before sending the WML tags/contents. Something like this..
<?
if ($HTTP_USER_AGENT != "Some mobile phone User Agent") {
// do other checking
}
// otherwise just display the WML content
header("Content-type: text/wml");
?>
<wml>
<card id="abc" title="123">
...
</card>
</wml>
where can i find these mobile phone user agent list for the various mobile phones?
Originally posted by localhost
where can i find these mobile phone user agent list for the various mobile phones?
google.com
Originally posted by alien
google.com
is this one?
http://www.nnh.co.uk/wap/dev_user_agent.html
but a bit blur... everything inside are mobile phone agents?
I think they are. Have to try it out yourself. :D
salmonella
04-09-2003, 18:49
They look like user agents, but that's certainly not a comprehensive list... If you plan on using this method, I hope you don't have japanese cellphone users. There are thousands of cellphone models in Japan, with a couple hundred added every month. Japan is an important part of Aligo's market because of this (their M-1 server renders content to appear properly on over 4000 devices, most of which are cellphones). Some phones may not even send user agents.
I think it might be simpler for you to do this from another direction - instead of accepting cellphone user agents, try rejecting IE user agents. That's supposed to be ~ 95% of users anyway, and is less likely to require constant updating.
Originally posted by salmonella
They look like user agents, but that's certainly not a comprehensive list... If you plan on using this method, I hope you don't have japanese cellphone users. There are thousands of cellphone models in Japan, with a couple hundred added every month. Japan is an important part of Aligo's market because of this (their M-1 server renders content to appear properly on over 4000 devices, most of which are cellphones). Some phones may not even send user agents.
I think it might be simpler for you to do this from another direction - instead of accepting cellphone user agents, try rejecting IE user agents. That's supposed to be ~ 95% of users anyway, and is less likely to require constant updating.
hmm okie :)
Originally posted by salmonella
They look like user agents, but that's certainly not a comprehensive list... If you plan on using this method, I hope you don't have japanese cellphone users. There are thousands of cellphone models in Japan, with a couple hundred added every month. Japan is an important part of Aligo's market because of this (their M-1 server renders content to appear properly on over 4000 devices, most of which are cellphones). Some phones may not even send user agents.
I think it might be simpler for you to do this from another direction - instead of accepting cellphone user agents, try rejecting IE user agents. That's supposed to be ~ 95% of users anyway, and is less likely to require constant updating.
From what I know, Japan mobile phones are different from the rest of the world, they have their own technology and usually far more advanced. I have not got any user from Japan, are you sure they are able to download the ringtones, logos, and stuffs?
And of course, I'm not suggesting doing thousand of if-else statement to check the USER-AGENT. One can easily come out with a better checking function.
salmonella
05-09-2003, 14:50
Nope, I have no idea if they can use the ringtones that he provides.
Haven't been to his site, but in general, WAP browsers browse WAP sites... so if someone has an unusual phone with a WAP browser and wants to use it to browse your website, you don't want to stop him even though you've never heard of his phone model before.
I didn't say that he'd use thousands of if-else statements. The maintenance problem is in adding new cellphone user agents as and when they appear (each week/month/year), not in writing a piece of code that would check whether the user agent matches a list. Hence my suggestion to approach it from the other direction - by denying desktop browsers without an appropriate referer, instead of allowing WAP browsers.
I really don't know anything about WAP, so this is probably a stupid question... Do WAP pages actually have images? I thought his intention at the start was to reduce hotlink in order to reduce bandwidth theft. That means that he wants to prevent others from "hotlinking" to his images. Would it be hard to use a script to make access control decisions to image files based on user agents?
You should just exclude the directory you are serving your wap pages from the hotlink protection. It serves no purpose there anyway.
salmonella
05-09-2003, 18:20
That's what I originally suggested ("a) enable hotlinking for your WAP site"), but I didn't realise its wisdom till your post - as you say, it serves no purpose there. <slaps head> Thanks Zoomer.
In case localhost wants elaboration, or someone else in the future is curious about hotlink protection, here are my arguments.
* localhost wants to do hotlink protection to conserve bandwidth.
* hotlink protection uses referer headers to determine if the browser is coming from your site or hotlinked from some other site
* WAP browsers can't be counted on to send a referer header. This means that they may be unable to view the site with hotlink protection enabled.
* (I think) WAP specific sites are formatted for constrained devices like mobile phones, and will be useless for unconstrained devices like PCs. So these tiny images are unlikely to be hotlinked for normal browsers.
* It's pointless to use User-Agents or any method to allow WAP browsers to browse the WAP-specific site. Hotlink protection still wouldn't work and other WAP sites are still able to hotlink your content as the idea behind hotlink protection (referer headers) doesn't work well in WAP. Since hotlink protection is useless, just remove it for the WAP-specific, and all WAP browsers can view it anyway.
Tell me if there's a flaw in my thinking somewhere.
They can hotlink your wap pages all they want, it wouldn't make any huge impact when your pages are in the range of xxx bytes.
vBulletin® v3.5.6, Copyright ©2000-2010, Jelsoft Enterprises Ltd.