Change the favicon in an image url

8.8k views Asked by At

I want to change the favicon of resources html display pages. I mean when i go to the image url i want to see my icon in the title bar not the icon of the server (in my case XAMPP).

4

There are 4 answers

1
Abdulla Nilam On

use this

<link rel="icon" type="image/ico" href="images/favicon.ico"/>

Read this Blog Article as well

7
Alex Shesterov On

Just put an ICO file named favicon.ico in document root.

A quick test is to open the URL http://my.domain/favicon.ico in a browser; it should display the icon.

Note that the icon file MUST be in document root. If you can't put the file there physically, you could use Apache's mod_alias to map the file to this URL. This is done by placing the following line in your server's configuration (httpd.conf file):

alias /favicon.ico /path/to/your/images/directory/favicon.ico
2
AudioBubble On

Add this to the <head> of your file:

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

make sure that the href link is correct.

0
JoSSte On

As the other posters have stated, you need to edit your HTML and in the section, add the line to show the favicon you have uploaded.

If you look at the source for this page, the line defining the favicon is this:

<link rel="shortcut icon" href="//cdn.sstatic.net/stackoverflow/img/favicon.ico?v=6cd6089ee7f6">

but the code stated elsewhere here will also work (<link rel="icon" type="image/x-icon" href="favicon.ico"/>)

Many browsers will automatically look for the favicon.ico in the root of the webserver (as Alex Shesterov wrote in a comment)