나는 프론트 엔드로 백엔드와 Angularjs로 SLIM 프레임 워크를 사용하고 있습니다. 일반 GET 및 POST API는 잘 작동합니다. GET 또는 POST 메소드에서 헤더를 전달할 때마다 404 오류가 발생합니다. 나는 .htaccess CORS 파일.SLIM php Angularjs CORS
RewriteEngine On
# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
# RewriteBase/
Header add Access-Control-Allow-Origin: "*"
Header add Access-Control-Allow-Headers: "origin, x-requested-with, content-type, authorization"
Header add Access-Control-Allow-Methods: "PUT, GET, POST, DELETE, OPTIONS"
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
제발 도와주세요.
서버의 오류 로그를 확인하십시오. 어떤 요청이 404 응답을 생성합니까? – Phil
귀하의 서버가 비행 전 OPTIONS 요청에 올바르게 응답하지 않습니다. 잡을 수있는 해결책을 찾을 수 있는지 보겠습니다. – Phil
ok. 나는 이것을 일주일 이상 해왔다. 나는 그것을 얻을 수 없다. – user3667960