global.asa to prevent linkng to images?

Discussion in 'ASP General' started by Bill, Oct 13, 2004.

  1. Bill

    Bill Guest

    If I've got images in a directory, and I define that directory as an
    application directory (so I have a global.asa in it), what does my
    global.asa have to look like to prevent linking of images?
    Bill, Oct 13, 2004
    #1
    1. Advertising

  2. global.asa cannot prevent hotlinking. While, yes, if someone goes directly
    to http://yoursite/image.jpg, a new session will be started and
    Session_OnStart will be fired, that file cannot send back any redirects or
    anything like that if that's what you were thinking. Unfortunately, IIS
    does not have a built-in way of preventing hotlinking. This solution is as
    good as any. http://www.aspfaq.com/show.asp?id=2276

    Ray at work

    "Bill" <> wrote in message
    news:...
    > If I've got images in a directory, and I define that directory as an
    > application directory (so I have a global.asa in it), what does my
    > global.asa have to look like to prevent linking of images?
    >
    >
    >
    Ray Costanzo [MVP], Oct 13, 2004
    #2
    1. Advertising

  3. Bill

    Bill Guest

    Thanks for the info. I didn't know that I couldn't place a Response.Redirect
    in Session_OnStart.

    Hey, in a related issue, is there a reference detailing what I can and
    cannot place into a global.asa file?

    Bill.


    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:%...
    > global.asa cannot prevent hotlinking. While, yes, if someone goes

    directly
    > to http://yoursite/image.jpg, a new session will be started and
    > Session_OnStart will be fired, that file cannot send back any redirects or
    > anything like that if that's what you were thinking. Unfortunately, IIS
    > does not have a built-in way of preventing hotlinking. This solution is

    as
    > good as any. http://www.aspfaq.com/show.asp?id=2276
    >
    > Ray at work
    >
    > "Bill" <> wrote in message
    > news:...
    > > If I've got images in a directory, and I define that directory as an
    > > application directory (so I have a global.asa in it), what does my
    > > global.asa have to look like to prevent linking of images?
    > >
    > >
    > >

    >
    >
    Bill, Oct 13, 2004
    #3
  4. Take a look here.
    http://msdn.microsoft.com/library/en-us/iissdk/iis/ref_scrpt_globalasaref.asp

    Ray at work

    "Bill" <> wrote in message
    news:...
    > Thanks for the info. I didn't know that I couldn't place a
    > Response.Redirect
    > in Session_OnStart.
    >
    > Hey, in a related issue, is there a reference detailing what I can and
    > cannot place into a global.asa file?
    >
    > Bill.
    >
    >
    > "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    > message news:%...
    >> global.asa cannot prevent hotlinking. While, yes, if someone goes

    > directly
    >> to http://yoursite/image.jpg, a new session will be started and
    >> Session_OnStart will be fired, that file cannot send back any redirects
    >> or
    >> anything like that if that's what you were thinking. Unfortunately, IIS
    >> does not have a built-in way of preventing hotlinking. This solution is

    > as
    >> good as any. http://www.aspfaq.com/show.asp?id=2276
    >>
    >> Ray at work
    >>
    >> "Bill" <> wrote in message
    >> news:...
    >> > If I've got images in a directory, and I define that directory as an
    >> > application directory (so I have a global.asa in it), what does my
    >> > global.asa have to look like to prevent linking of images?
    >> >
    >> >
    >> >

    >>
    >>

    >
    >
    Ray Costanzo [MVP], Oct 13, 2004
    #4
  5. Bill

    Bill Guest

    Well, that page you referenced was useless.

    But it linked to
    http://msdn.microsoft.com/library/en-us/iissdk/iis/ref_scrpt_glsesevntonstart.asp

    which demonstrates that you CAN place Response.Redirect in Session_OnStart
    !!!

    So, I'm gonna have to experiment to find the truth, right?




    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:...
    > Take a look here.
    >

    http://msdn.microsoft.com/library/en-us/iissdk/iis/ref_scrpt_globalasaref.asp
    >
    > Ray at work
    >
    > "Bill" <> wrote in message
    > news:...
    > > Thanks for the info. I didn't know that I couldn't place a
    > > Response.Redirect
    > > in Session_OnStart.
    > >
    > > Hey, in a related issue, is there a reference detailing what I can and
    > > cannot place into a global.asa file?
    > >
    > > Bill.
    > >
    > >
    > > "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    > > message news:%...
    > >> global.asa cannot prevent hotlinking. While, yes, if someone goes

    > > directly
    > >> to http://yoursite/image.jpg, a new session will be started and
    > >> Session_OnStart will be fired, that file cannot send back any redirects
    > >> or
    > >> anything like that if that's what you were thinking. Unfortunately,

    IIS
    > >> does not have a built-in way of preventing hotlinking. This solution

    is
    > > as
    > >> good as any. http://www.aspfaq.com/show.asp?id=2276
    > >>
    > >> Ray at work
    > >>
    > >> "Bill" <> wrote in message
    > >> news:...
    > >> > If I've got images in a directory, and I define that directory as an
    > >> > application directory (so I have a global.asa in it), what does my
    > >> > global.asa have to look like to prevent linking of images?
    > >> >
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >
    Bill, Oct 16, 2004
    #5
  6. Ray Costanzo [MVP], Oct 17, 2004
    #6
  7. Bill wrote:
    > Well, that page you referenced was useless.
    >
    > But it linked to
    > http://msdn.microsoft.com/library/en-us/iissdk/iis/ref_scrpt_glsesevntonstart.asp
    >
    > which demonstrates that you CAN place Response.Redirect in
    > Session_OnStart !!!
    >


    Given that it linked to a page that gave you what you were looking for, i
    would hardly call it "useless". It's very rare to find a single page that
    contains ALL the answers ...

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Oct 17, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Darlene Gauthier

    PostRequestHandlerExecute event in global.asa

    Darlene Gauthier, Jul 23, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,412
    Karl Seguin
    Jul 23, 2003
  2. Kevin Spencer

    Re: global.asa file (count sessions)

    Kevin Spencer, Jul 30, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    347
    Kevin Spencer
    Jul 30, 2003
  3. DevBoy

    Global.asa File ?????

    DevBoy, Aug 12, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    345
    Rick Strahl [MVP]
    Aug 13, 2003
  4. Wayne
    Replies:
    2
    Views:
    456
    Wayne
    Nov 11, 2003
  5. Raghu
    Replies:
    1
    Views:
    4,014
    Raghu
    Feb 17, 2005
Loading...

Share This Page