Hmm okay, makes sense. Instead of looking for browsers that are supposed to support something, looking for that support.
So now I added the server config to my .htacess file. The only other thing there are mime-types.
Here is my entire .htacess file:
RewriteRule /?svgtest.svg$ /svgTest.php [L]
Code:
# ----------------------------------------------------------------------
# Proper MIME type for all files
# ----------------------------------------------------------------------
AddType application/javascript js
# Audio
AddType audio/ogg oga ogg
AddType audio/mp4 m4a
# Video
AddType video/ogg ogv
AddType video/mp4 mp4 m4v
AddType video/webm webm
# SVG.
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
# Webfonts
AddType application/vnd.ms-fontobject eot
AddType application/x-font-ttf ttf ttc
AddType font/opentype otf
AddType application/x-font-woff woff
# Assorted types
AddType image/x-icon ico
AddType image/webp webp
AddType text/cache-manifest appcache manifest
AddType text/x-component htc
AddType application/x-chrome-extension crx
AddType application/x-xpinstall xpi
AddType application/octet-stream safariextz
AddType text/x-vcard vcf
And then I created the file svgTest.php and it contains only the following:
PHP Code:
$subject = 'SVG Header test';
$message = 'Accept Header: ' . $_SERVER["HTTP_ACCEPT"];
$to = '[****@gmail.com]';
$headers = "MIME-Version: 1.0 \r\n" ;
$headers .= "Content-Type: text/plain \r\n";
$headers .= "From: <[****@gmail.com]> \r\n\r\n";
mail($to, $subject, $message, $headers);
#Note, the to email is that same as the from-header email. Was I supposed to do this? I assumed explicitylt assigning it to my email because there is no form to give it the actual sender's email.
Now, If I know my apache / .htaccess well enough, the code you told me to put in the .htacess sends the user to svgTest.php when they visit svgtest.svg, right?
But my question is why do that? The user is never going to visit the svg, it will be loaded as a svg css background-image. Also why redirect the user to a file that emails me especially if that original file will never be visited?
I don't understand / what is the point of sending me the email?
After reading your, Mittineague 's, post again, I see the point of the email is to learn what headers are sent.
But from then on, what do I do? Or in better context, am I supposed to compare the HTTP_ACCEPT header for svg to the data the e-mail set e. Thus, seeing if it is one of the headers a browser accepts and if so, then serve an svg image?
Regards,
Team 1504
P.S. Here is a link to the svgtest.
Bookmarks