Description of the question: I want to install my site "Access-Control-Allow-Origin", so I installed it in the apache configuration (almost anywhere), but it does not work. I also set other headers for testing, but it still doesn't work.
Apache version: 2.2.22
Apache Modules: http://www.anwcl.com/test/show_modules.php
My destination URL:
http://www.anwcl.com/test/test_only_div.html
And it is associated with my local file:
e:\wamp\www\test\test_only_div.html
And here are my apache configurations:
E: \ WAMP \ Bin \ Apache \ apache2.2.22 \ conf \ httpd.conf
... LoadModule headers_module modules/mod_headers.so ... Include conf/extra/httpd-vhosts.conf ...
E: \ WAMP \ Bin \ Apache \ apache2.2.22 \ conf \ additional \ HTTPd-vhosts.conf
NameVirtualHost *:80 <VirtualHost *:80> Header add Access-Control-Allow-Origin "*" Header echo ^TS Header add MyHeader "Hello Joe. It took %D microseconds for Apache to serve this request." ServerAdmin xxx@gmail.com DocumentRoot "E:/wamp/www/" ServerName www.anwcl.com ErrorLog "logs/xxx.log" CustomLog "logs/xxx.log" common <Directory "E:/wamp/www/"> Header add Access-Control-Allow-Origin "*" Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
E: \ WAMP \ WWW \ .htaccess
Header add Access-Control-Allow-Origin "*" Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type" Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
E: \ WAMP \ WWW \ test \ .htaccess
Header add Access-Control-Allow-Origin "*" Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type" Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
And here Wireshark closes, there are no expected headers:
http://www.anwcl.com/question/apache-mod-headers-not-working.jpg http://www.anwcl.com/question/apache-mod-headers-not-working-304.jpg