How to Change the Favicon for a Web Application


How to add and display a Favicon in a web project.

 Adding the Favicon to a Web Project

The icon in the top left corner of a web page is called the Favicon, short for favorites icon. By default, it is found on a web site at ./favicon.ico. The web browser will look for the <link rel="icon"...> entry in the <head> section of a web page for the favicon. EG:

    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>

If no <link rel="icon"...> entry exists, the web browser will search for this file in the host root directory.

To use your own icon, create a favicon.ico icon and place it in the webroot of your Alpha Anywhere project then publish the project to the server. If you want to specify more than one favicon for your application, specify it using <link rel="icon"...> in the <head> portion of your web page.

If you are using the stand-alone Alpha Anywhere Application Server, Alpha Anywhere will supply a favicon for you if you do not create one. If you don't want to display either your icon or the Alpha Anywhere favicon, you can disable this functionality in the Application Server Control Panel on Advanced tab in Built-in Resources section.

 Displaying the new Favicon

Favicon.ico is cached very aggressively by web browsers, so a change is often not seen without effort. First clear the browser's cache, then make a request for http://<your server>/favicon.ico to force the new icon to be loaded. It may also be necessary to restart the browser after this if the icon shown in the address bar still has not updated.