Answer the question
In order to leave comments, you need to log in
How to remove the 403 error when linking to an image on another site?
There are two sites (both mine):
1) api.example.com
2) app.example.com
I'm trying to upload images to app.example.com with the following path: api.example.com/res/images/...
( I'm also trying to do this on a local server).
I end up getting a 403 error when I try to upload an image. The logs are clean, which is strange for me.
How to solve this problem?
RewriteEngine On
# Директива включает редиректы.
RewriteBase /
# Без директивы (.*) = /$1 будет /var/wwww/site/web/$1 с директивой = /$1
Options +FollowSymLinks
# Разрешает переход по символическим ссылкам.
php_flag display_errors off
# запретить отображение ошибок (требование монитора качества)
php_flag allow_url_fopen off
# запретить использовать удаленные файлы (требование проактивной защиты)
DirectoryIndex index.php
RewriteRule ^(.*)$ index.php
SetEnvIf Origin "http(s)?://(www\.)?(тут мои домены|и статические ip моего пк)$" AccessControlAllowOrigin=$0
Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
Header merge Vary Origin
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question