Hello everyone again,
I notice a problem when attempting to share a post from the Pinterest button below the post copy. It spawns a pinterest window and I am logged into pinterest, but the image is broken.
The window goes to this link:
http://www.pinterest.com/pin/create/button/?url=http://www.mydomain.com/directory/&media=http://www.mydomain.com/images/photo.jpg
I can view the photo just fine when viewing the link. I even changed permissions on it from 644 to 755 to see if that was the cause.
Also notice this generates a 301 error in Screaming Frog SEO Spider. Also noticing 302 and 301 errors with the other share buttons.
Any ideas?
Thank you so much.
Newspaper: 4.3
Mac Desktop
Chrome, Firefox and Safari Browsers.
Just figured out what was the problem:
I have the following code in my root htaccess file:
# BLOCK HOTLINKING TO IMAGES
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mydomain.com/ [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ http://i.imgur.com/g7ptdBB.png [NC,R,L]
# END BLOCK HOTLINKING TO IMAGES
So my question would be how to allow for pinterest, facebook and twitter etc. It is crucial to ban hotlinking for our site.
Thank you so much.
All fixed.
# BLOCK HOTLINKING TO IMAGES
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mydomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?facebook.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?pinterest.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?twitter.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yahoo.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?msn.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?bing.com/.*$ [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ http://i.imgur.com/g7ptdBB.png [NC,R,L]
# END BLOCK HOTLINKING TO IMAGES
Now all the share buttons work great and no one can steal my images either.
You can test hotlink protection at:
http://altlab.com/htaccess_tutorial.html
If you would like to make it more complicated by expanding the hotlink protection, this link is good:
http://perishablepress.com/creating-the-ultimate-htaccess-anti-hotlinking-strategy/
FINAL UPDATE:
I decided to delete the code from the htaccess file for hotlinking protection.
I read this article and I don’t want to have any troubles with Google:
https://blog.serps.com/google-not-provided-image-hotlinking-nofollow-link-building/