Cannot get Favicon.ico to display

前端 未结 8 2147
死守一世寂寞
死守一世寂寞 2021-01-02 08:55

I have copied my favicon.ico file to my Apache document root. I had to add an Apache Rewrite exception for it and now it is accessible from www.example.com/favicon.ico. Bu

相关标签:
8条回答
  • 2021-01-02 09:11

    Try throwing this tag in the head of your document:

    <link href="/favicon.ico" type="image/x-icon" rel="icon" />
    
    0 讨论(0)
  • 2021-01-02 09:24

    the favicon.ico reference must be an absolute URL, not relative. Using this:

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

    My status was

    favicon.ico () shows up in:
    
        IE 9.0.8
        Safari 5.1.7 
    
    Fails in:
    
        FF 28.0
        Google Chrome 34.0
    

    changing to absolute values

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

    causes all browsers to locate and display the favicon.ico

    0 讨论(0)
提交回复
热议问题