Allow image to another server from secure site


#1

I want to allow a secure image to be used on another site for this client … spaboom.com … on my old server I just typed in the address of the image and it would upload and be used in the secure section of the spaboom site. I’m having trouble getting it to work here though. I keep getting denial for the image. Tried a few different .htaccess options and I’m not that good with it … can’t get it to work.

here is image >> https://integrativemedicinenw.com/images/mosaic/red_logo_for_spaboom.jpg

Forbidden

You don’t have permission to access /images/mosaic/red_logo_for_spaboom.jpg on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I’ve tried a few different .htaccess rules, but am obviously not getting it right

not sure how to proceed … thanks!


#2

Try this:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?spaboom\.com/.*$ [NC]
RewriteRule \.(gif|jpg|png)$ [F]

Note: If this throws a 500 error, remove the second line. I added it because your host site is https (you said it is a “secure image”) but depending on the server config, that second line may be troublesome.


#3

I tried both ways as I understood it … maybe I have something wrong??

RewriteEngine On RewriteBase / RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?spaboom\.com/.*$ [NC] RewriteRule \.(gif|jpg|png)$ [F]

and

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?spaboom\.com/.*$ [NC]
RewriteRule \.(gif|jpg|png)$ [F]

Both gave me the same forbidden and 404 errors listed above.

Can you tell me how to allow ANYONE to view images in a certain folder (https://www.integrativemedicinenw.com/images/)
just the .gif/.jpg/.png like you have listed here? I tried to take out the two RewriteCond lines, but that didn’t work either.

I figure if I can get it to work without the request having to come from spaboom (which is harder for me to test) then I can add that part later.

appreciate the help!


#4

Remove any and all .htaccess files from the directory.

[quote=“marepinta, post:1, topic:60824”]here is image >> https://integrativemedicinenw.com/images/mosaic/red_logo_for_spaboom.jpg

Forbidden

You don’t have permission to access /images/mosaic/red_logo_for_spaboom.jpg on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I’ve tried a few different .htaccess rules, but am obviously not getting it right

not sure how to proceed … thanks!
[/quote]

You need to ensure the directory path and image actually exist. Check via an SFTP client if you think it’s a server error.