Master da Web
Back to Blog

Access-Control-Allow-Origin: Origin is therefore not allowed access

LucasNovember 16, 20161 min readUpdated on November 4, 2023
Access-Control-Allow-Origin: Origin is therefore not allowed access

When the client application makes a request to a port other than the origin port, the server usually returns in its header which origins are allowed, so the browser issues the Warning in its console:

How to solve the problem?

Considering that the server uses PHP, to solve the problem add the following line at the beginning of your code:

<?php
header('Access-Control-Allow-Origin: *');
?>

This will allow requests to be sent from any source.

Share

Need Hosting or Servers?

Discover our VPS, dedicated servers and professional hosting solutions

Related Articles

View all articles