title: axios preflight fail error 301 using vue.js
body: <p>I've got a Laravel 5.4 API, that works fine in Postman and the Browser. Localhost works fine- Laravel 5.4 is running on one port, and Vue in hot deploy mode is running fine.</p>
  
  <p>However, when I move the Vue code to my production server I get this error:</p>
  
  <pre><code>Response for preflight is invalid (redirect)
  </code></pre>
  
  <p>In Chrome Developer Tools, the network tab shows this:</p>
  
  <p><strong>General</strong></p>
  
  <pre><code>Request URL:http://backend-dev.xolas.io/api/v1/view/calendar/-30/90/
  Request Method:OPTIONS
  Status Code:301 Moved Permanently
  Remote Address:217.182.66.247:80
  Referrer Policy:no-referrer-when-downgrade
  </code></pre>
  
  <p><strong>Response Headers</strong></p>
  
  <pre><code>Connection:Keep-Alive
  Content-Length:349
  Content-Type:text/html; charset=iso-8859-1
  Date:Mon, 10 Jul 2017 13:40:08 GMT
  Keep-Alive:timeout=5, max=100
  Location:http://backend-dev.xolas.io/api/v1/view/calendar/-30/90
  Server:Apache/2.4.25 (Ubuntu)
  </code></pre>
  
  <p><strong>Origin Headers</strong></p>
  
  <pre><code>Accept:*/*
  Accept-Encoding:gzip, deflate
  Accept-Language:en-US,en;q=0.8
  Access-Control-Request-Headers:access-control-allow-origin,authorization
  Access-Control-Request-Method:GET
  Connection:keep-alive
  Host:backend-dev.xolas.io
  Origin:http://localhost:8080
  Referer:http://localhost:8080/
  User-Agent:Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.109 Mobile Safari/537.36
  </code></pre>
  
  <p>I've installed a CORS plugin on Laravel, still no joy.</p>
  
  <p>My <strong>axios config</strong> is as follows:</p>
  
  <pre><code>axios.defaults.headers.common['Authorization'] = store.apiKey
  axios.defaults.headers.get['Content-Type'] = 'application/json;charset=utf-8'
  axios.defaults.headers.post['Content-Type'] = 'application/json;charset=utf-8'
  axios.defaults.headers.common['Access-Control-Allow-Origin'] = 'https://' + store.endpoint + ', http://' + store.endpoint
  </code></pre>
  
  <p>Endpoint is Larvel API server, which works fine.</p>
  
  <p>Any clues would help, since I'm at a loss on how to resolve this. Thanks in advance.</p>