How To Allow Cross-Site Javascript Using Apache
erics, Posted September 24th, 2015 at 3:43:52pm
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> |
Leave Your Comment
All fields marked with "*" are required.