How To Allow Cross-Site Javascript Using Apache
erics, September 24th, 2015
The key is to send a response header like this: Access-Control-Allow-Origin: * In the Apache web server, one enables this via the following directive: Header set Access-Control-Allow-Origin * This requires the use of mod_headers, which is enabled by default in Apache. For example:
1 2 3 4 5 6 7 8 9 |
LoadModule headers_module modules/mod_headers.so ... <VirtualHost *:80> ServerName www.your.domain ServerAlias *your.domain DocumentRoot /var/www/yourdomain DirectoryIndex index.php index.html Header set Access-Control-Allow-Origin * </VirtualHost> |