Images are served from a folder outside Apache’s public folder and Aliases are not wanted.
What is the keyword, if existing, to get the real path of the htaccess that contains the rewriting rules ?
# /website1.com/public/prod/ --> index.php & .htaccess
# /website1.com/assets/images/
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^images/(.*)$ REALPATH/../../assets/images/$1 [L]
# REALPATH doesn't work of course
# not wanted :
# RewriteRule ^images/(.*)$ /website1.com/public/prod/assets/images/$1 [L]
You can’t access files outside of .htaccess directory, even using absolute path. Solution could be to make symbolic link in current folder that points to your images directory and then point your .htaccess rule to this file.
Your rule then should look like this: