Convenient practice for where to place images?
- by Baumr
A lot of developers place all image files inside a central directory, for example:
/i/img/
/images/
/img/
Isn't it better (e.g. content architecture, on-page SEO, code maintainability, filename maintainability, etc.) to place them inside the relevant directories in which they are used?
For example:
example.com/logo.jpg
example.com/about/photo-of-me.jpg
example.com/contact/map.png
example.com/products/category1-square.png
example.com/products/category2-square.png
example.com/products/category1/product1-thumb.jpg
example.com/products/category1/product2-thumb.jpg
example.com/products/category1/product1/product1-large.jpg
example.com/products/category1/product1/product2-large.jpg
example.com/products/category1/product1/product3-large.jpg
What is the best practice here regarding all possible considerations (for static non-CMS websites)?
N.B. The names product1-large and product1-thumb are just examples in this context to illustrate what kind of images they are. It is advised to use descriptive filenames for SEO benefit.