-1

I have created a web page using laravel where the images of the products i am getting from the backend via url: https://examole.com/cache/medium/product/3954/Wl2 +spitak.jpg. If the name of the image contains "+", then I cant get an image in front and receive a 404 erro, but in the admin, I can see the image. If I change the "+" symbol for example to "-" then I can get the image on my front. Any solutions???

Artak
  • 1

2 Answers2

2

+ is a reserved symbol.

You can use it but with all URLs in HTML, the special characters need to be encoded.

What you probably have:

<img src="https://examole.com/cache/medium/product/3954/Wl2 +spitak.jpg">

What it should be:

<img src="https://examole.com/cache/medium/product/3954/Wl2%20%2Bspitak.jpg">

Encoding the blankspace to %20 and the + symbol to %2B.

Daniel W.
  • 31,164
  • 13
  • 93
  • 151
1

Sometimes PHP can be a bit finicky with things like this. Try replacing + with its UTF-8 escape character, %2B

3ddavies
  • 546
  • 2
  • 19