Jeffrey Simon
Jeffrey Simon

Reputation: 1034

favicons return 403 forbidden on local machine

We have recently upgraded our favicons so that they are accessed via the apache Alias function. They work just fine on several of our servers, but on my local development machine they return 403 errors.

The various servers are running Ubuntu; my local machine is a Mac. The stacks are pretty similar though. Before using the Alias function to locate the favicon file structure outside the docroot, we never had this problem.

This 403 issue on favicons is reported somewhat commonly. Unfortunately the standard solutions do not help. Here are some of the standard solutions:

The relevant portion of the config is as follows:

Alias /favicon /Users/jas/Websites/RepHunter/cfg/local/favicon/
Alias /favicon.ico /Users/jas/Websites/RepHunter/cfg/local/favicon/favicon.ico
<Directory "/Users/jas/Websites/RepHunter/favicon/>
        Options None
        Require all granted
        AllowOverride None
</Directory>

The console tab of Dev Tools shows the following:

from Dev Tools, console tab

Again: we get no such errors on the other servers--only on my local.

EDIT 1:

Taking the suggestion from Gordon Davisson, we moved the favicon files completely outside /Users. That still did not work. As a next step, we put the favicon files back into /favicon in the docroot, the way you are supposed to do it, without using the alias. That removed the 403 errors.

Interim conclusion:

  1. Either we still have something incorrect in the configuration
  2. Or macOS requires that favicon files must be in the docroot, and using an apache alias does not work. This is odd because apache aliases work fine on the Mac for other types of files, and the aliases for the favicon files work just fine on other servers.

My suspicion is that there is something in the configuration that is wrong.

Another point that I should have put in the original question: the favicon actually works as seen in the browser tab for the page. It is just that we get the 403 forbidden errors in the network tab of Dev Tools for each of the six or so files in the favicon folder.

Upvotes: 0

Views: 370

Answers (0)

Related Questions