{"id":3190,"date":"2020-08-03T12:09:51","date_gmt":"2020-08-03T12:09:51","guid":{"rendered":"https:\/\/chemicloud.com\/kb\/?post_type=ht_kb&#038;p=3190"},"modified":"2022-04-13T10:07:17","modified_gmt":"2022-04-13T10:07:17","slug":"enable-cross-origin-resource-sharing-cors","status":"publish","type":"ht_kb","link":"https:\/\/chemicloud.com\/kb\/article\/enable-cross-origin-resource-sharing-cors\/","title":{"rendered":"How to enable Cross-Origin Resource Sharing (CORS)"},"content":{"rendered":"<p>Cross-Origin Resource Sharing (CORS) is a specification that enables truly open access across domain boundaries. If you serve public content, please consider using CORS to open it up for universal JavaScript\/browser access.<\/p>\n<p>CORS introduces a standard mechanism that can be used by all browsers for implementing cross-domain requests.<\/p>\n<p>To enable it, set CORS header to the <code>.htaccess<\/code>\u00a0file, by adding the following line of code:<\/p>\n<pre>&lt;IfModule mod_headers.c&gt; \r\nHeader set Access-Control-Allow-Origin *\r\n&lt;\/IfModule&gt;<\/pre>\n<p class=\"p1\"><b>Are you tired of slow web hosting? We use LiteSpeed caching to deliver content to your visitors almost instantly. <\/b>\u26a1<b>\u00a0Check out our <\/b><span style=\"text-decoration: underline;\"><a href=\"https:\/\/chemicloud.com\/pricing#60b65e4e63b58\" target=\"_blank\" rel=\"noopener\"><span class=\"s1\"><b>web hosting <\/b><\/span><\/a><\/span><b>plans!<\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cross-Origin Resource Sharing (CORS) is a specification that enables truly open access across domain boundaries. If you serve public content, please consider using CORS to open it up for universal JavaScript\/browser access. CORS introduces a standard mechanism that can be used by all browsers for implementing cross-domain requests. To enable&#8230;<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"ht-kb-category":[34],"ht-kb-tag":[],"class_list":["post-3190","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-troubleshooting"],"_links":{"self":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/3190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/comments?post=3190"}],"version-history":[{"count":4,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/3190\/revisions"}],"predecessor-version":[{"id":7364,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/3190\/revisions\/7364"}],"wp:attachment":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/media?parent=3190"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=3190"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=3190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}