It you try to Googling around you will find than at this time is not easy to Catching Up this Solution…
Sometime get Complicate to get some Big Fish on the WWW… But some time get Easy ;)
This will work on Every Os: Linux, Windows, macOS X and even in Unix :))
-
Login in the Amazon AWS Console
Select Amazon S3 from Drop Down list Click “Sign in the AWS Console”
Insert your Credentials -
Amazon S3 > Properties > Edit Bucket policy
Insert: (Substitute only YOUR-BUCKET-NAME and your-domain-name){
"Version":"2008-10-17",
"Id":"",
"Statement":[{
"Sid":"Allow in my domains",
"Effect":"Allow",
"Principal":{
"AWS":"*"
},
"Action":"s3:GetObject",
"Resource":"arn:aws:s3:::YOUR-BUCKET-NAME/*",
"Condition":{
"StringLike":{
"aws:Referer":["http://your-domain-name/*",
"http://www.your-domain-name/*"
]
}
}
},
{
"Sid":"Give not access if referer is no my sites",
"Effect":"Deny",
"Principal":{
"AWS":"*"
},
"Action":"s3:GetObject",
"Resource":"arn:aws:s3:::YOUR-BUCKET-NAME/*",
"Condition":{
"StringNotLike":{
"aws:Referer":["http://your-domain-name/*",
"http://www.your-domain-name/*"
]
}
}
}
]
}
Save
- Test Properly If the Bucket Policy Effectively and Definitely Prevent Hotlinking