tecadmin.net

How to Disable Image Hotlinking in Apache

What is Image Hotlinking? To display an image on a website from another website. For example, you have created some stunning images on your website and another user uses that images on their website using your domain link. In this case whenever the other user’s website loads, The image is load from your website. This can increase the hosting cost for you. This tutorial will help you to prevent image hotlinking on Apache using .htaccess. Disable Image Hotlinking Add the following rules in .htaccess of your website. This will block all...

csstricks

What if we got aspect-ratio sized images by doing almost nothing?

Say you have an image you're using in an <img> that is 800x600 pixels. Will it actually display as 800px wide on your site? It's very likely that it will not. We tend to put images into flexible container elements, and the image inside is set to width: 100%;. So perhaps that image ends up as 721px wide, or 381px wide, or whatever. What doesn't change is that images aspect ratio, lest you squish it awkwardly (ignoring the special use-case object-fit scenario). So—we don't know how much vertical space an image is going to occupy until that...