views:

29

answers:

1

I have a stylesheet that accesses an svg in the same directory as the stylesheet. Firefox will get the svg on my test server and on the subdirectory. However, it refuses to attempt to download the svg when accessed from the subdomain.

I tried adding svg to the list of files in an .htaccess file on the subdirectory's highest level, which is also the solution to get firefox to accept @font-face from a subdirectory. I probably did this wrong, but I will include anyway.

<FilesMatch "\.(ttf|otf|eot|svg)$">
<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>

Thanks!

Edit, css rule being used:

.mask {
filter:url('mask.svg');
} 
A: 

A 'filter' property should always have a fragment part, otherwise it won't apply. You probably want something like:

.mask {
filter: url('mask.svg#myFilter');
}
Erik Dahlström
I have added an identifier in the svg and fragment to the link. Works on subdirectory, test server; but not from subdomain.
Jordan
Remember that the base url is taken from the stylesheet location, so if you use it anywhere else you need to make sure it still points to the same file, eg. `filter: url('/foo/mask.svg#myfilter')` or `filter: url('http://whatever.domain.com/foo/bar/mask.svg#myFilter')`
Erik Dahlström
I've attempted to adjust those URLs, I have tried a few different combinations just to rule them out as well. SVG is still accessible with the previous location when viewing from the subdirectory.
Jordan