Welcome Guest, Not a member yet? Register   Sign In
Debugbar CORS - Console error
#3

Add to your .htaccess file along side where index.php is.
Code:
    ## For CORS Configuration

    # Add Font Types
    AddType application/vnd.ms-fontobject .eot
    AddType application/x-font-ttf        .ttf
    AddType application/x-font-opentype  .otf
    AddType application/font-woff        .woff
    AddType application/font-woff2        .woff2

    <IfModule mod_headers.c>
        <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|svg|svgz|jpg|png|ico|font.css|css|js)$">
            ## un-remark this one for all access and remark out the one below it
            #Header set Access-Control-Allow-Origin "*"
            ## Change this to your local host url. and https or http
            Header add Access-Control-Allow-Origin: "https://your.com"
            Header add Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT"
            Header add Access-Control-Allow-Headers: "Upgrade-Insecure-Requests"
        </FilesMatch>
    </IfModule>

    # Remove index.php from URL
    RewriteCond %{HTTP:X-Requested-With}    !^XMLHttpRequest$
    RewriteCond %{THE_REQUEST}              ^[^/]*/index\.php [NC]
    RewriteRule ^index\.php(.*)$            $1 [R=301,NS,L]

Try that, it's what I use.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: Debugbar CORS - Console error - by paliz - 07-08-2021, 09:18 AM
RE: Debugbar CORS - Console error - by InsiteFX - 07-08-2021, 09:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB