• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
The Electric Toolbox Blog

The Electric Toolbox Blog

Linux, Apache, Nginx, MySQL, Javascript and PHP articles

  • Applications
  • FCKEditor
  • Apache
  • Windows
  • Contact Us
Home / Apache and icons directory

Apache and icons directory

Default installations of Apache usually alias /icons to Apache’s icons directory which cannot be overridden in an .htaccess file. If you do not control the Apache configuration of a server, and for maximum compatibility, it is always best to never have an /icons directory at a website’s root level.

Example default configuration

On a Debian box, for example, the following is defined at /etc/apache2/mods-available/alias.conf:

Alias /icons/ "/usr/share/apache2/icons/"

If you control the server you could easily enough disable this alias, or change it to something else. The alias directive cannot be changed in a .htaccess file so if you do not control the server you will not be able to change it.

As I mentioned in the opening paragraph it’s better for compatibility purposes to assume you can never change this so if you have to move your website to another server you don’t have issues.

The solution

I ran into this issue the other day when I decided on a new website to put the icons I was using for some admin pages into a directory called /icons at the website’s root level. Of course, I ended up without the icons displaying and a bunch of 404 errors in my log file like this:

File does not exist: /usr/share/apache2/icons/myicon.png

The best solution is to either put your icons directory into a subdirectory, or give it a different name if it’s at the root level. In my case I moved it so it was a subdirectory of /images.

Check Out These Related posts:

  1. Installing maildrop on CentOS 5
  2. Install PHP without Apache on Debian
  3. New_Face failed error when using Mplayer
  4. Getting Transaction Check Error with Yum

Filed Under: Apache

Primary Sidebar

Categories

  • Apache
  • Applications
  • Article
  • Case Studies
  • Email Servers
  • FCKEditor
  • HTML And CSS
  • Javascript
  • Linux/Unix/BSD
  • Microsoft SQL Server
  • Miscellaneous Postings
  • MySql
  • Networking
  • Nginx Web Server
  • Offsite Articles
  • OSX
  • PHP
  • Quick Tips
  • RFC – Request for Comments
  • SilverStripe
  • VMWare
  • VPN
  • Windows
  • WordPress

Recent Posts

  • Vim Show Line Numbers
  • Add User To Group Linux
  • Chmod 777 Tutorial
  • How to Copy Directory Linux
  • Linux create user

Copyright © 2021. ElectricToolBox. All Rights Reserved.

  • Contact Us
  • Copyright Info
  • Privacy Policy
  • Sitemap