title: Ionic - XMLHttpRequest cannot load
body: <p>I have an Ionic PWA, so it runs in browser. I'm trying to send requests to my symfony backend. At first I had everything installed on my local pc and the requests were working with an ionic proxy. Now I have installed both applications on a server. At first I have tried to use the url from the backend without proxy. Then there was a CORS error. Then I wrote a .htaccess file for the backend with the following input:</p>
  
  <pre><code>Header add Access-Control-Allow-Origin "\*"
  Header add Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT"
  </code></pre>
  
  <p>Now I'm getting this:</p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load
    ... Response for preflight
    has invalid HTTP status code 405</p>
  </blockquote>
  
  <p>If I set a proxy as before on the local installation like this:</p>
  
  <pre><code>"proxies": [
      {
        "path": "/api",
        "proxyUrl": "http://api.example.com/api"
      }
    ]
  </code></pre>
  
  <p>I'm getting a 404 not found error, when I try to send a request to <a href="http://app.example.com/api" rel="nofollow noreferrer">http://app.example.com/api</a></p>
  
  <p>Can someone tell me how it will work correctly when frontend and backend are on a server and the app runs in the browser?</p>