473,382 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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

.....Thanks!



Jul 19 '05 #1
4 2573
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
-------------------

Jul 19 '05 #2
*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/
Jul 19 '05 #3

"Andrew Urquhart" <us**************************@com.invalid> wrote in
message news:1w***************@usenet.andrewu.co.uk...
*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.


Jul 19 '05 #4
*Bill* wrote in microsoft.public.inetserver.asp.general:
"Andrew Urquhart" <us**************************@com.invalid> wrote in
message news:1w***************@usenet.andrewu.co.uk...
*Bill* wrote in microsoft.public.inetserver.asp.general:
strQueryString = LCase(getSerVar("QUERY_STRING"))
If InStr(strQueryString, "favicon.ico") <= 0 Then
' WHAT GOES HERE TO PROVIDE THE .ICO FILE?
End If
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()


THANKS, Andrew! I got that to work,


Oh good!
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?


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/
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Lian Liming | last post by:
Hi, all I want to write my own error handler function in php by using "set_error_handler()" function. I have made a test for this function but found it did not work. My test code is as following:...
1
by: anonymous | last post by:
Can someone help me? I have an error handler that is not working correct. Below is a snippet, for some reason it read through, all the way to the error handler though there is not one. Thanks. ...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
2
by: Steve Richfield | last post by:
My error handler works GREAT. However, VBA seems to have some bugs/features that are causing it fits. The little snippet that I put at the end of each routine looks like this: Error_Handler: If...
3
by: deko | last post by:
I have a logging routine that's supposed to silently log errors caught by error handler code on certain functions. The problem is sometimes stuff happens and the error handler can get caught in a...
2
by: robert d via AccessMonster.com | last post by:
I have a module with an error handler section. At the top of the module is the following statement: On Error GoTo Err_Ctrl In the error handler is a conditional If statement based on an error...
2
by: Lucas Tam | last post by:
Without writing try/catch statements is there a way to have a global error handler in VB.NET? In ASP.NET there is an application level error handler inside Global.asax, but is there something...
10
by: robert d via AccessMonster.com | last post by:
I have a global error handler that up until today has been working flawlessly. Let me first provide the relevant code **************************************************************** On Error...
2
by: Jukka Aho | last post by:
When converting Unicode strings to legacy character encodings, it is possible to register a custom error handler that will catch and process all code points that do not have a direct equivalent in...
2
by: yeghia \(sosy\) | last post by:
Hi Guys I have two questions. 1. Is there a way to set a handler to .NET application so that in case of not caught exception my handler is called before application shutdown. I want to send an...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.