The custom fonts I am using on my website aren't provided by IIS 8.5.
I have set the MIME-Types as followed:
<remove fileExtension=".ttf" />
<remove fileExtension=".woff" />
<remove fileExtension=".woff2" />
<remove fileExtension=".eot" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
.eot works fine (or at least doesn't give me errors in the web debugging windows).
The other formats (woff, woff2, tff) won't work and give me a 404 Not found error.
I think IIS has access to the fonts folder as the eot files work just fine.
Firefox throws this error:
GET
https://prefix.someurl.iis/Resources/Fonts/GlyphaLTStd.woff [HTTP/1.1 404 Not Found 53ms]
Any help appreciated.
Alright, I was able to fix it.
Turns out my lazyness got in the way again (why does this keep happening..?).
Lazy me copied the reference source paths in the font-face declarations so the CSS file didn't get the source-url properly somehow.
Hope this helps other people.
Related
I have added some mime that I needed for my project in MVC5 because in production it did not work.
<system.webServer>
<staticContent>
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/x-font-woff2" />
<mimeMap fileExtension=".js.min" mimeType="text/javascript" />
</staticContent>
</system.webServer>
Once added I have published and the app works correctly.
When trying to debug the app in local with VisualStudio, it doesn't find any mime.
If I comment the code of the Web.config it works correctly in local but not in production.
How can I not be commenting and uncommenting this code?
I have made the following implementation and I have managed to make everything work correctly both in the production version and in the local version
<system.webServer>
<staticContent>
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff2" mimeType="application/x-font-woff2" />
<remove fileExtension=".js.min" />
<mimeMap fileExtension=".js.min" mimeType="text/javascript" />
</staticContent>
</system.webServer>
I could find the solution here reference
When setting up universal links for iOS apps, Apple states:
Create an apple-app-site-association file that contains JSON data about the URLs that your app can handle.
Upload the apple-app-site-association file to your HTTPS web server. You can place the file at the root of your server or in the
.well-known subdirectory.
We have created a file named "apple-app-site-association" without an extension, but if navigate to "http://ourdomain.com/apple-app-site-association" we get a 404 file not found error.
Apple specifies not to add a .json to the filename.
We see another SO overflow answer describing configuration changes to IIS to serve files without extensions. But what is the trick to getting this file to be served properly from GoDaddy's Linux or IIS servers?
I was able to get this to work by adding an .htaccess file at the root level that contains:
<Files "apple-app-site-association">
ForceType application/json
</Files>
Oddly, I could not get this to work if I tried to put the apple-app-site-association and the .htaccess files in the .well_known directory.
With this configuration, the validator here https://branch.io/resources/universal-links/ was all green and the links themselves worked.
This is what worked for us.
We put this text in a file named "web.config" in our main web directory along with the apple-app-site-association file.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".xml"/>
<remove fileExtension=".svg" />
<remove fileExtension=".ttf" />
<remove fileExtension=".eot" />
<remove fileExtension=".woff" />
<remove fileExtension=".json" />
<remove fileExtension=".otf" />
<remove fileExtension=".mp4" />
<remove fileExtension=".zip"/>
<remove fileExtension=".eps"/>
<remove fileExtension=".pdf"/>
<mimeMap fileExtension=".pdf" mimeType="application/pdf" />
<mimeMap fileExtension=".zip" mimeType="application/zip"/>
<mimeMap fileExtension=".eps" mimeType="application/octet-stream"/>
<mimeMap fileExtension=".json" mimeType="application/json" />
<mimeMap fileExtension=".otf" mimeType="application/octet-stream" />
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".xml" mimeType="text/xml" />
<mimeMap fileExtension="." mimeType="application/pkcs7-mime"/>
</staticContent>
</system.webServer>
</configuration>
Of note, that properly serves the file without an extension - BUT - as we understand it - Apple still requires two other steps. (1) Your server must get an SSL certificate so it can serve that file by HTTPS (that is a ~$60/year purchase on GoDaddy); (2) Your server must also code-sign the apple-app-site-association file (that is a ~$150/year on GoDaddy for a downloadable certificate which can code sign files.)
There seems to be a strange problem with my Azure webapp. I can't view MP4 files on my browser at all. After exploring few articles here, I did the following:
I use Github continuous deployment, so I created a new file called "Web.config". The content of it is the following:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".svg" />
<remove fileExtension=".eot" />
<remove fileExtension=".woff" />
<remove fileExtension=".woff2" />
<remove fileExtension=".mp4" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".woff" mimeType="application/x-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
</staticContent>
</system.webServer>
</configuration>
I made sure on the FTP that the file exists in the '/site/wwwroot' directory, and it does. I also made sure the MP4 file exists on the FTP in an accessible location.
The error I get on the website is the following:
The resource you are looking for has been removed, had its name
changed, or is temporarily unavailable.
Can anyone help me debug this problem?
Following our discussion, your web.config is right.
You have to make sure to locate it in the right location to make it works (the virtual application root in your case).
As Azure App Service is using IIS, you can find more details regarding IIS configuration files here: http://www.iis.net/learn/get-started/planning-your-iis-architecture/deep-dive-into-iis-configuration-with-iis-7-and-iis-8
I hope this helps,
Does anyone know if it is possible to add the SVG mime type to a Windows Azure Website?
I tried with a web.config file but that only broke my website.
Is this a limitation of the current preview or am I missing something?
thanks for your help!
What you can do in Windows Azure Websites (on web.config level) is pretty limited, but you should be allowed to add the mime type under staticContent:
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".svg"/>
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
</staticContent>
</system.webServer>
</configuration>
Others like me may have reached here having the same problem not resolved because of other related file types, in my case I also needed .eot and .woff mime mappings.
<system.webServer>
<staticContent>
<remove fileExtension=".svg" />
<remove fileExtension=".eot" />
<remove fileExtension=".woff" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".woff" mimeType="application/x-woff" />
</staticContent>
</system.webServer>
I have encountered a completely unexpected behavior when adding a mimeMap element for files with mp3 extensions. This works fine:
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true" />
<staticContent>
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<mimeMap fileExtension=".ogv" mimeType="video/ogg" />
<mimeMap fileExtension=".webm" mimeType="video/webm" />
<mimeMap fileExtension=".ogg" mimeType="audio/ogg" />
<!-- <mimeMap fileExtension=".mp3" mimeType="audio/mpeg" /> -->
</staticContent>
</system.webServer>
But as soon as I uncomment the element pertaining to MP3 files, everything goes to hell in a proverbial handbasket. Neither my js nor my css nor my aspx files will be served, and I get lots of these:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Anyone seen this behavior before, or have any pointers? I am (clearly) less than adept in IIS configuration.
this behavior might be because.. In IIS the mimetype for mp3 is already configured.
you adding in web.config mimemap for mp3 will cause duplicate entry.
just do
<remove fileExtension=".mp3"/>
<mimeMap fileExtension=".mp3" mimeType="audio/mpeg" />
regards
Goutham Ganesh V