Can Javacript files be run from .htaccess file?

Discussion in 'JavaScript' started by grafx77, Aug 28, 2009.

  1. #1
    If I have a banner on my server (www.mywebsite.com/banner.jpg) and it is is placed on another website, calling the image from my server, can I have the .htaccess file call on a javascript code/file to run on the other website?

    I believe this is feasible.....
     
    grafx77, Aug 28, 2009 IP
  2. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #2
    blind belief only gets you so far... especially so when you are wrong. :D

    you can replace it with the contents of a js file but the problem is, at the other end the referal is probably an <img> element so whatever data you send through will be treated as image data only and will never eval as js.

    but you can check referal and if it matches said site, you can redirect to some nasty image instead - this tends to put off ppl stealing bandwith a fair bit.
     
    dimitar christoff, Aug 28, 2009 IP