Hi I am working with an API that retrieves the URL of an image. I am then trying to pass that URL into an tag as follows:
<img class="img-fluid" src={this.state.representatives[i].pic}/>
Locally I am met with
But when I try to use the app on AWS Amplify, I am met with:
I have tried hardcoding the URL into the app but it returns the same error. I am really confused where to go from here.
For example the image URL pulled from the API for Mark Warner is http://bioguide.congress.gov/bioguide/photo/W/W000805.jpg
and I know I am not messing with this URL as it loads locally. Am I making a simple error somewhere?
Go to App Settings -> Redirects and Rewrites and change the
source address: </^[^.]+$|.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/>
Type from 200 (Rewrite) to 404 (Rewrite)
I appreciate Ammar T.'s answer, but I just add some cherry to his answer. So if your binary file extension is something else, which is not available in the
</^[^.]+$|.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/>
this, then just add that extension into it. i.e I was using a .jpeg file, so for me I had to modify it into
</^[^.]+$|.(?!(css|gif|ico|jpg|jpeg|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/>
this.
Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With