Posts Tagged ‘IIS7’

WordPress and PHP on Windows Server 2008

Guess what? WordPress rocks on Windows Server 2008 and IIS7. Congratulation to Microsoft for the effort. If you didn’t know Microsoft created the FastCGI component to address previous performance issues with PHP on Windows. At the same time Zend worked to make PHP more stable on Windows. The two combined to make reliable and high performance PHP on Windows. FastCGI support is now built in to Windows Server 2008. There is plenty of documentation available for setting everything up manually but let me tell you this, don’t waste your time. Microsoft is really getting serious about PHP on Windows. They have created the Web Platform Installer 2.0 and that’s all you really need. Once you install the Web Platform Installer you can run it and choose to install applications like WordPress and Joomla. The installer checks to see if you have the necessary components, if you don’t then it downloads and installs them. This includes PHP, MySQL, and the application, like WordPress. It also installs an IIS URL ReWrite module so you can have pretty permalinks for your WordPress Blog. For novice or inexperienced Windows server admins I recommend you let the Platform Installer take care of everything for you.

For advanced users I will warn you that, at the time of my last install you could not change the default install path for MySql or PHP. This is easy to get around, just download and install PHP and MySql before you use the Platform Installer for the first time to set up WordPress. The Platform Installer will recognize your installations. Happy Blogging.

Almost forgot, here is how you create 301 redirects on Windows Server 2008 (and server 2003 with IIS6) if you are migrating from an existing site to a CMS platform.

—David Blizzard

301 Redirect on Windows Server

I see a lot of complaints from SEO and Internet Marketing agencies about the hoops they jump through to get Windows Server admins or hosts to create 301 redirects for clients. It is really not difficult at all. I decided to outline the steps so the next time one of you has an issue with a web host you can just copy this info and send it to them or link to it 😉 That might make them feel pretty dumb, but it will get the job done.

IIS6:

Redirect a single file.

  1. Open IIS Manager and locate the website
  2. Right click the file you want to redirect and choose properties
  3. Change the selector to “A Redirection to a URL”
  4. In the “Redirect To:” box type the new URL
  5. Put a check in “A permanent redirection for this resource” (this results in an HTTP status code of: HTTP/1.1 301 Moved Permanently)

That’s it!

Redirect an entire domain name – website.

  1. Open IIS Manager and locate the website
  2. Right click the Website you want to redirect and choose properties
  3. Select the “Home Directory Tab”
  4. Change the selector to “A Redirection to a URL”
  5. In the “Redirect To:” box type the new URL
  6. Put a check in “A permanent redirection for this resource” (this results in an HTTP status code of: HTTP/1.1 301 Moved Permanently)

OPTIONAL: Check “The exact URL entered above” if you want all pages redirected to the home page of the new domain rather than relative pages in the new domain.

IIS 7:

Redirect a single file.

  1. Open IIS Manager and locate the website under sites
  2. Right click the website and choose “switch to content view”
  3. In the right hand pane locate the file you want to redirect
  4. Right click the file and choose “switch to features view”
  5. Important! Verify that it shows the correct file name at the top of the screen
  6. Under the IIS section open “HTTP Redirect”
  7. Put a check in “Redirect requests to this destination” and type in the new URL
  8. Change the status code to “Permanent 301”
  9. Click Apply (this results in an HTTP status code of: HTTP/1.1 301 Moved Permanently)

That’s it!

Redirect an entire domain name – web site.

  1. Open IIS Manager and locate the website under sites
  2. Important! Verify that it shows the correct website name at the top of the screen
  3. Under the IIS section open “HTTP Redirect”
  4. Put a check in “Redirect requests to this destination” and type in the new URL
  5. Change the status code to “Permanent 301”
  6. Click Apply (this results in an HTTP status code of: HTTP/1.1 301 Moved Permanently)

OPTIONAL: Check the “redirect all requests to exact destination (instead of relative to destination)”

New in IIS 7:

For those that understand XML and the web.config file you can add a line similar to the following in the <configuration> section rather than using IIS Manager:

Domain redirect:

<system.webServer>
<httpRedirect enabled=”true” destination=”http://www.my-new-site.com” httpResponseStatus=”Permanent” />
</system.webServer>

File Redirect:

<location path=”my-old-file.htm”>
<system.webServer>
<httpRedirect enabled=”true” destination=”http://www.new-domain.com/my-new-file.htm” exactDestination=”true” httpResponseStatus=”Permanent” />
</system.webServer>
</location>

* copy and pasting the web.config examples could result in the wrong quotes which will cause an error. Re-type your quotes.

—David Blizzard