Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

htaccess or handlers, setting a default web icon maybe

JosiahMaybe

Gold Coder
I have heard that there is some way to set a default favicon for non-HTML files maybe using .htaccess or a file handler. File (Apache) handlers are a bit out of like my league but if I could I would increase default font size also. Main thing is how to have a default favicon set.

Here is a twist, I find like a GIF, PNG, GIF declaration in HTML works almost everywhere, could I in .htaccess have like declare GIF, PNG, GIF icon for compatibility and not raise errors? I am on shared DirectAdmin hosting with asurahosting.com hosting gugquettex.com.

I am kind of scared to try .htaccess stuff. I do not suppose this would interfere with loading file contents but am unsure. Main question, on raw hosting, how to set a favicon for default and secondary, how to have GIF main but PNG for compatibility? I know favicon.ico loads auto, any other way? There is not two favicon.ico. X E.
 
Solution
I have heard that there is some way to set a default favicon for non-HTML files maybe using .htaccess or a file handler. File (Apache) handlers are a bit out of like my league but if I could I would increase default font size also. Main thing is how to have a default favicon set.

Here is a twist, I find like a GIF, PNG, GIF declaration in HTML works almost everywhere, could I in .htaccess have like declare GIF, PNG, GIF icon for compatibility and not raise errors? I am on shared DirectAdmin hosting with asurahosting.com hosting gugquettex.com.

I am kind of scared to try .htaccess stuff. I do not suppose this would interfere with loading file contents but am unsure. Main question, on raw hosting, how to set a favicon for default...
I have heard that there is some way to set a default favicon for non-HTML files maybe using .htaccess or a file handler. File (Apache) handlers are a bit out of like my league but if I could I would increase default font size also. Main thing is how to have a default favicon set.

Here is a twist, I find like a GIF, PNG, GIF declaration in HTML works almost everywhere, could I in .htaccess have like declare GIF, PNG, GIF icon for compatibility and not raise errors? I am on shared DirectAdmin hosting with asurahosting.com hosting gugquettex.com.

I am kind of scared to try .htaccess stuff. I do not suppose this would interfere with loading file contents but am unsure. Main question, on raw hosting, how to set a favicon for default and secondary, how to have GIF main but PNG for compatibility? I know favicon.ico loads auto, any other way? There is not two favicon.ico. X E.

What you might need is something like this:
Code:
RewriteEngine On 
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond favicon.ico 
RewriteRule .* favicon.ico [L]
or if that doesn't work,
Code:
RewriteEngine On 
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule "^(.+)favicon\.ico(|\?.+)$"  "/favicon.ico" [PT]

For context, I did a bit of looking and found that on stackoverflow,
 
Solution
Yeah, I was looking for a way to do like one but if that does not work do another. It looks like that is not possible. Anyway, I expect stack overflow to be with creative commons and anyway that is still one logo. I guess just having a favicon.ico is what I can do. I was trying for how text displays from a file doing like add custom icon code to generated HTML like GIF, PNG, GIF. Looks impossible. X E.
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom