CORS errors on my domain
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

CORS errors on my domain

by
Louis-RomainP
Created on 2024-04-02 08:55:54 (edited on 2024-09-04 14:26:21) in Web Hosting

I am developping an app locally on my machine and it sends XHR request to my domain on OVH.

The problem is I receive CORS errors.
In the .htaccess I wrote this:
AuthType Basic
AuthName "Le petit blond"
AuthUserFile /home/gwwdpcf/www/app/.htpasswd
require valid-user

# Header add Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT"
# Header add Access-Control-Allow-Origin "*"

# Enable cross domain access control
Header add Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "GET, POST, PUT, DELETE"
Header always set Access-Control-Allow-Headers: Authorization
Header set Access-Control-Allow-Credentials true


# Force to request 200 for options
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule .* / [R=200,L]

Can you help please ?
Thanks