IIS

  • How to fix ASP.NET 3.5 websites not running on Windows Server 2012

    ASP.NET 3.5 websites not running on a newly setup Windows Server 2008

    I had an issue the other day where a new Windows Server 2012 installation was not running my older ASP.NET 3.5 web sites. Everytime I would try to navigate to a .net 3.5 website I would see a '404: page not found' error message.

    If I manually typed in a path containing a '.html' file this would load without any issues for me but '.aspx' files would not load. I noticed that the Mapping Handler was missing settings for older asp.net code - everything was asp.net 4.0. This explained why .html files were ok but .aspx files were returning a 404. The server just didn't know what to do with .aspx files for older .net sites.

    I opened the Add Roles and Features Wizard (go to Control Panel, Turn Windows features on or off) and drilled into the IIS web server to ensure that asp.net 3.5 was installed but noticed that only ASP.NET 4.0 was installed on the server. To fix this I simply had to tick the checkbox for .Net Extensibility 3.5 and ASP.NET 3.5. You can find these checkboxes by drilling into the following tree menu:

    • Web Server (IIS) (installed)

      • Web Server (Installed)

        • Application Development (Installed)

          • .Net Extensibility 3.5
          • ASP.NET 3.5

    If you get asked about restarting the server you can leave that checkbox unchecked as this install won't require a server reboot. Remember to restart IIS or recycle the app pool and website before you try and browse to your .net 3.5 website for the new settings to take effect.

  • How to compress SVG in IIS

    how to compress svg mimetypes in IIS

    Most people know about turning on compression in IIS. In recent versions of IIS it's been a simple case of ticking a checkbox to turn it on. I noticed the other day that svg files on one of my sites were not being compressed by default.

    If you use Bootstrap or one of the other well known frameworks, or you're designing your site for mobile, chances are that you'll be using svg file format for your some of your fonts. By default IIS does not compress this file mimetype. Doing so could help save on bandwidth and help speed up your site for your end users.

  • IIS 7 returning 404 error with extension less URL

    iis7 404 error with extensionless url asp.net 4.0

    I was recently working on updated an older asp.net 3.5 website to asp.net 4.0.  Unfortunately we can't upgrade to 4.5 due to the risk of breaking other sites on the same server. Our reason for the upgrade was really to take advantage of the routing ability that was built into asp.net 4.0 for webforms.

    If you're looking for help on setting up .net routing you can take a look at a simple 'how to' for setting up routing with WebForms here that I wrote a few years back.

    The issue I was having was that IIS was returning a 404 page not found error when I tried to go to a url without the .aspx. I had setup my global.asax file with the correct routing information but it was like IIS was ignoring these rules.

    C#, IIS7
  • How to convert a .htaccess file for use in your Web.Config file on Windows Server

    How to convert a htaccess file for use on Windows Server

    If you're running a Windows Server and you have to run PHP websites on it chances are that you will be asked to apply rules from a .htaccess file to one of the websites on your server. Windows Server does not use .htaccess files. These usually come from Apache servers. However, Windows Servers use a similar file called the Web.Config file located at the root of all your websites hosted on your Windows Server.

    You'll be glad to know that there is a converter built into IIS 7 that will convert any .htaccess rules into the format required for the Web.Config file. To convert your .htaccess file simply follow these instructions:

  • The dreaded Server Application Unavailable IIS error

    The dreaded Server Application Unavailable IIS error

    Server Application Unavailable

    Is there any error more annoying in .net web development? I hate this error because it's so unhelpful. I actually got this error today and it took me a while to track down what the issue was thanks to that rubbish error message being returned to me.

    One of the guys inside in work setup the project for me for a new website but never changed the .net settings from the default asp.net 2 runtime to the asp.net 4 runtime. "No problem" I thought and I quickly updated the runtime from .net 2 to .net 4 using my handy command.

  • Apply a different ASP.NET runtime to your website without restarting IIS 6

    If you have ever had to change the default asp.net runtime in IIS 6 you might have noticed that it warns you about restarting all of the other websites before it can be applied. On small servers with a handful of sites it's not a big deal. If you have a server that runs a lot of mission critical stuff it's more of a hassle.

    Luckily there is an easy workaround for this. All you need to do it use the command line to specify the asp.net runtime you want to target and the IIS identifier you want to apply it to. So once you have setup your website in IIS open up the command prompt and type in:

    C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis -s w3svc/123456789/root -norestart

    Simply replace the 123456789 numbers with the identifier value for your website. Usually this value is on the same line as your domain name in IIS 6. If it's not you can add the Identifier column from View -> Add/Remove.

    The line should make sense just by looking at it. The first part is specifying the asp.net runtime you want to target (asp.net 4 in this example) next up we have the IIS identifier followed by a no restart flag.

    It's a shame that you even have to do this at all but at least the option is straightforward enough not to make it too much of a burden.

  • How to setup Wordpress on Windows Server 2008 with IIS 7

    I recently had to install and setup a few Wordpress blogs onto Windows Server 2008. No biggy I thought. I'll just install Wordpress using the Web Platform Installer and away I go. Unfortunately it's never that easy! Below are the steps I took, the pitfalls I came up against and the solutions I have to getting Wordpress setup.

  • IIS7 ASP Routing not working on live server

    We had an issue at work the other day where one of the developers was having an issue with asp routing in IIS7. It was the first time this particular server was asked to run a .net 4 website so naturally some fine tuning was required. When we tried to navigate to the webpage the following error appeared: 403: Access Permission Denied

  • Eurl.axd error when redirecting from one asp.net 4 website to another in IIS 6

    I recently came across an unusual error when trying to redirect to an asp.net 4 website from another website in IIS6. This came about because a client had 2 domains hosted with us. One domain, lets call it Web1, was setup using asp.net 4 and had a website on it. The other domain, Web2, was just used for emails and contained no website.

  • ← Older Posts

Get In Touch

Follow me online at TwitterFacebook or Flickr.

Latest Tweets