Redirecting favicon.ico in the Error 404 handler?

Discussion in 'ASP General' started by Bill, Sep 9, 2004.

  1. Bill

    Bill Guest

    I want to add a favicon.ico to one of my websites. Because this is a large
    site, with two domains sharing an IP, I want to be able to redirect the
    favicon .ICO file from my VBScript Error 404 file (depending upon the domain
    name). Anybody have directions for doing this?


    In my Error 404 file, I can place this is the partocilar domain secitons"

    -------------------
    strQueryString = LCase(getSerVar("QUERY_STRING"))
    If InStr(strQueryString, "favicon.ico") <= 0 Then
    ' WHAT GOES HERE TO PROVIDE THE .ICO FILE?
    End If
    -------------------

    .....Thanks!
     
    Bill, Sep 9, 2004
    #1
    1. Advertising

  2. Bill

    Bill Guest

    Re: Redirecting favicon.ico in the Error 404 handler CORRECTION

    Sorry, here is the corrected code - the second line must be > and not <=


    > -------------------
    > strQueryString = LCase(getSerVar("QUERY_STRING"))
    > If InStr(strQueryString, "favicon.ico") > 0 Then
    > ' WHAT GOES HERE TO PROVIDE THE .ICO FILE?
    > End If
    > -------------------
     
    Bill, Sep 9, 2004
    #2
    1. Advertising

  3. Bill

    Bill Guest

    "Andrew Urquhart" <> wrote in
    message news:...
    > *Bill* wrote in microsoft.public.inetserver.asp.general:
    > > I want to add a favicon.ico to one of my websites. Because this is a

    large
    > > site, with two domains sharing an IP, I want to be able to redirect the
    > > favicon .ICO file from my VBScript Error 404 file (depending upon the

    domain
    > > name). Anybody have directions for doing this?
    > >
    > > In my Error 404 file, I can place this is the partocilar domain

    secitons"
    > >
    > > -------------------
    > > strQueryString = LCase(getSerVar("QUERY_STRING"))
    > > If InStr(strQueryString, "favicon.ico") <= 0 Then
    > > ' WHAT GOES HERE TO PROVIDE THE .ICO FILE?
    > > End If
    > > -------------------
    > >
    > > ....Thanks!

    >
    > You could ADODB stream it, but you might find that the following is
    > sufficient (as well as faster and more efficient):
    >
    > Response.ContentType = "image/x-icon"
    > Server.Transfer("/images/myFavicon.ico")
    > Response.End()
    > --
    > Andrew Urquhart
    > - FAQ: http://www.aspfaq.com
    > - Archive: http://tinyurl.com/38kzx (Google Groups)
    > - Contact me: http://andrewu.co.uk/contact/


    THANKS, Andrew! I got that to work, except for the Server.Transfer
    statement... I had to do:

    Server.Transfer("myFavicon.ico")

    Isn't Server.Transfer supposed to be a path, and not a relative URL?

    Bill.
     
    Bill, Sep 9, 2004
    #3
    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. Kevin Spencer

    favicon.ico and long pathnames

    Kevin Spencer, Jan 20, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    425
  2. Patrick Olurotimi Ige

    Having favicon.ico instead of IE.ico on a website

    Patrick Olurotimi Ige, Dec 9, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    3,525
    Martin Dechev
    Dec 9, 2004
  3. Valente Silva

    A problem with a favicon.ico

    Valente Silva, Dec 30, 2003, in forum: HTML
    Replies:
    1
    Views:
    456
  4. Jan Faerber

    favicon.ico

    Jan Faerber, Jan 5, 2004, in forum: HTML
    Replies:
    1
    Views:
    469
    Toby A Inkster
    Jan 5, 2004
  5. Mel
    Replies:
    1
    Views:
    407
    Steve Pugh
    Mar 9, 2005
Loading...

Share This Page