Font MIME Types

Posted by ben 19. March 2011 22:09

We’ve been using custom fonts more and more lately and I always forget the MIME types. So here they are:

WOFF – font/x-woff
TTF – font/ttf
OTF – font/otf
EOT – application/vnd.ms-fontobject
SVG – image/svg+xml

Tags: ,
Categories General | Development

Custom ASP.NET MVC Error Pages on IIS 7.5

Posted by ben 19. March 2011 21:47

This caught me out today. On IIS 6/Casini my custom error pages rendered fine. When I deployed my site, a 404 error displayed the IIS error page, not the one defined in my application.

The solution is to add the following to the system.webserver section of web.config:

<system.webServer>
	...
	<httpErrors errorMode="Detailed"/>

The way in which I define custom error pages in ASP.NET MVC is to create an “Error” controller with an action method for each error code, for example:

    public class ErrorController : Controller
    {
        public ActionResult NotFound()
        {
            var message = "Resource not found";
            return new HttpStatusCodeViewResult(404, message);
        }
    }

I then wire it up in web.config like so:

    <customErrors mode="RemoteOnly">
      <error statusCode="404" redirect="error/notfound"/>
    </customErrors>

Tags: ,
Categories ASP.NET | C# | Development | IIS

Skype, IIS and SSL problems

Posted by ben 27. July 2010 05:40

I ran into a problem today where I had created a self signed SSL certificate in IIS and as soon as I added the appropriate bindings to my web site, IIS would stop the site. The only way I could get the site back up and running (on standard HTTP) was to remove the SSL binding.

So I figured that another process must be running on that port. At first I thought it was VisualSVN, but then I remembered I had this on port 8080.

Imagine my disbelief then when running TCPView that it was Skype who was listening away on port 443:

image

A quick look into the Skype advanced settings (Tools > Options > Advanced > Connection) revealed an option that I promptly disabled:

image

Sure enough, I restarted Skype (to apply the changes), added my SSL binding and I was able to start the site and access it from my browser.

Tags: ,
Categories General