Wednesday, January 25, 2017

Enabling cors authorization policy

Glyph icons missing and are boxes instead of logo

to fix this error create a crossdomain.xml file in /var/www/html

The file contains :

<?xml version="1.0" ?>
<cross-domain-policy>
<allow-access-from domain="*"/>
<site-control permitted-cross-domain-policies="master-only"/>

</cross-domain-policy>

After creating file run command : apachectl -t

and also to allow mod_headers include the below lines in apache configuration file i.e httpd.conf

<Files ~ "^\.ht">
    Require all denied

    Header always set Access-Control-Allow-Origin "*"
    Header always set Access-Control-Max-Age "1000"
    Header always set Access-Control-Allow-Headers "X-Requested-With, Content-Type, Origin, Authorization, Accept, Client-Security-Token, Accept-Encoding"
    Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
</Files>

<IfModule mod_headers.c>
 Header set Access-Control-Allow-Origin "*"
</IfModule>

at the end of the file

write the rewrite engine rule

RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]



next reload the apache service : service httpd reload


If it's doesn't fix the error in Internet Explorer

Do the following changes in Internet Properties.



No comments:

Post a Comment