Redirect Image Url to a page via htaccess

You’ll need to add a rewrite rule to your .htaccess:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !/wp-admin/ [NC]
    RewriteRule ^wp-content/uploads/.+?\.(jpe?g|png|gif|svg)$ /my-page [R=301,L]
</IfModule>

Add this after anything added by WordPress. You’ll need to replace /my-page with the slug of the page you’d like to redirect to.

error code: 523