I want to redirect
www.domain.com/images/Apple.jpg
to
www.domain.com/Apple.html
Assuming you have mod_rewrite
enabled in your Apache:
RewriteEngine On
RewriteBase /
RewriteRule ^images/([^\.]+)\.(jpe?g|png) /$1.html [QSA,L]
Edit: as noticed by Wh1T3h4Ck5, QSA
(Query String Append) flag would be optional, as well as L
(Last) would depend on the context and other rules present. Please, read about RewriteRule flags for more information.
To clarify: this solution assumes that an HTML document with the name of the image already exists. Something like:
<html>
<head>
<title>Apple</title>
</head>
<body>
<img src="images/Apple.jpg" alt="Apple">
</body>
</html>
This is not an optimal solution for a large number of images, but it seemed to fit OP's case.