The below steps will assist you in enabling CORS for your website hosted on our Windows shared hosting packages.
- Download your web.config file via FTP.
- Edit your web.config file and add the below code.
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>
Your web.config should look like the example below once done
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
- Save the edited web.config file and upload this to your wwwroot folder for your website or the same location that it was downloaded from.
- Ensure that any existing web.config file is overwritten.
- Browse your website again to test if this has worked. CORS should now be enabled for you.