.htaccess - Access-Control-Allow-Origin

时间:2015-12-04 13:10:38

标签: apache .htaccess mod-rewrite

我将我的网站迁移到其他域名,但我遇到了Access-Control-Allow-Origin问题 - 新网站中没有显示字体,我已经更改了.htacces但是 新网站仍然会从我的旧网站上读取所有.css。请指教,问题是什么。

旧网站.htaccess

hlidanimazlicka.cz/test

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /test/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /test/index.php [L]
</IfModule>

# END WordPress

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

新网站.htaccess

studio120.eu

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

# Apache config
<FilesMatch ".(eot|ttf|otf|woff)">
 Header set Access-Control-Allow-Origin "*"
</FilesMatch>

# nginx config
#if ($filename ~* ^.*?\.(eot)|(ttf)|(woff)$){
# add_header Access-Control-Allow-Origin *;
#}

0 个答案:

没有答案