Redirect images to a page with .htaccess -


i know if possible set redirect in htaccess file if other website directly links image on site, instead of image opening in browser window on own, page image hosted on displayed.

this page has same name image i.e. if image other site linking is

www.mysite.com/imagename.jpg

then want redirect page called

www.mysite.com/imagename/

try code :

rewriteengine on rewritecond %{http_referer} !^www\.mysite\.com$ rewriterule ^wp-content/main/[0-9]{4}_[0-9]{2}/([\.]+)\.(jpe?g|gif|png)$ /$1/ [r=301] 

Comments