D
D
Danil Razumkov2018-05-13 10:13:51
Images
Danil Razumkov, 2018-05-13 10:13:51

Image problem, how to solve?

I have two subdomains, (different folders on the VPS) 1 of them is the client part, the other is the server part, and here are the problems with it. There are images on it, but when I try to get a picture through the href of img, I get an error in the console 403. I suspect that the problem is in .htaccess
Here is the file itself:

<IfModule mod_headers.c>
    SetEnvIf Origin "http(s)?://(www\.)?(google.com|staging.google.com|development.google.com|case.cgs-game.ru|localhost:8080)$" AccessControlAllowOrigin=$0
    Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
    Header add Access-Control-Allow-Credentials "true"
</IfModule>

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?case.cgs-game.ru.*$ [NC]
RewriteRule \.(jpe?g|bmp|gif|png|css|zip|pdf|txt|doc)$ - [NC,F,L]

At the same time, if you follow a direct link to an image, and then back to the site, the images are loaded.
I don’t understand htaccess, so if the problem is in it, write a ready-made solution.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question