Redirecting favicon.ico in the Error 404 handler?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bill

    Redirecting favicon.ico in the Error 404 handler?

    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(strQueryS tring, "favicon.ic o") <= 0 Then
    ' WHAT GOES HERE TO PROVIDE THE .ICO FILE?
    End If
    -------------------

    .....Thanks!









  • Bill

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

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

    [color=blue]
    > -------------------
    > strQueryString = LCase(getSerVar ("QUERY_STRING" ))
    > If InStr(strQueryS tring, "favicon.ic o") > 0 Then
    > ' WHAT GOES HERE TO PROVIDE THE .ICO FILE?
    > End If
    > -------------------[/color]


    Comment

    • Andrew Urquhart

      #3
      Re: Redirecting favicon.ico in the Error 404 handler?

      *Bill* wrote in microsoft.publi c.inetserver.as p.general:[color=blue]
      > 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(strQueryS tring, "favicon.ic o") <= 0 Then
      > ' WHAT GOES HERE TO PROVIDE THE .ICO FILE?
      > End If
      > -------------------
      >
      > ....Thanks![/color]

      You could ADODB stream it, but you might find that the following is
      sufficient (as well as faster and more efficient):

      Response.Conten tType = "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/

      Comment

      • Bill

        #4
        Re: Redirecting favicon.ico in the Error 404 handler?


        "Andrew Urquhart" <useWebsiteInSi gnatureToReply@ com.invalid> wrote in
        message news:1wp2uhixoi jt8.dlg@usenet. andrewu.co.uk.. .[color=blue]
        > *Bill* wrote in microsoft.publi c.inetserver.as p.general:[color=green]
        > > I want to add a favicon.ico to one of my websites. Because this is a[/color][/color]
        large[color=blue][color=green]
        > > 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[/color][/color]
        domain[color=blue][color=green]
        > > name). Anybody have directions for doing this?
        > >
        > > In my Error 404 file, I can place this is the partocilar domain[/color][/color]
        secitons"[color=blue][color=green]
        > >
        > > -------------------
        > > strQueryString = LCase(getSerVar ("QUERY_STRING" ))
        > > If InStr(strQueryS tring, "favicon.ic o") <= 0 Then
        > > ' WHAT GOES HERE TO PROVIDE THE .ICO FILE?
        > > End If
        > > -------------------
        > >
        > > ....Thanks![/color]
        >
        > You could ADODB stream it, but you might find that the following is
        > sufficient (as well as faster and more efficient):
        >
        > Response.Conten tType = "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/[/color]

        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.






        Comment

        • Andrew Urquhart

          #5
          Re: Redirecting favicon.ico in the Error 404 handler?

          *Bill* wrote in microsoft.publi c.inetserver.as p.general:[color=blue]
          > "Andrew Urquhart" <useWebsiteInSi gnatureToReply@ com.invalid> wrote in
          > message news:1wp2uhixoi jt8.dlg@usenet. andrewu.co.uk.. .[color=green]
          >> *Bill* wrote in microsoft.publi c.inetserver.as p.general:[color=darkred]
          >>> strQueryString = LCase(getSerVar ("QUERY_STRING" ))
          >>> If InStr(strQueryS tring, "favicon.ic o") <= 0 Then
          >>> ' WHAT GOES HERE TO PROVIDE THE .ICO FILE?
          >>> End If[/color]
          >>
          >> You could ADODB stream it, but you might find that the following is
          >> sufficient (as well as faster and more efficient):
          >>
          >> Response.Conten tType = "image/x-icon"
          >> Server.Transfer ("/images/myFavicon.ico")
          >> Response.End()[/color]
          >
          > THANKS, Andrew! I got that to work,[/color]

          Oh good!
          [color=blue]
          > 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?[/color]

          It takes a relative path :-)
          --
          Andrew Urquhart
          - FAQ: http://www.aspfaq.com
          - Archive: http://tinyurl.com/38kzx (Google Groups)
          - Contact me: http://andrewu.co.uk/contact/

          Comment

          Working...