Pretty Wordpress Permalinks on IIS Shared Hosting

Blogging Software Add comments

We all want pretty and search-engine friendly URLs for our blog posts. The most common format is /%year%/%monthnum%/%day%/%postname%/ as it gives users and search engines optimal information about the topic and the month of the post (er, you might want to check out the URL of this post for an example).

As it turns out, having Wordpress generate such URLs is possible on IIS in a shared hosting environment without much effort and there is no need to move to an Apache host with mod_rewrite etc.

The “official” procedure recommended by Wordpress is here. It entails editing your Windows Server’s php.ini file. However, most shared-hosting companies (I currently use Crystaltech) will not do this for the entire server just so that your blog can have pretty URLs.

There’s a much easier way:

  1. Create a text file in the root of your blog and name it php.ini. Paste the following two lines:
    cgi.fix_pathinfo = 1
    cgi.force_redirect = 0
  2. Then simply change the permalink structure in your Wordpress control panel to:
    /index.php/%year%/%monthnum%/%day%/%postname%/

To get rid of the leading “/index.php/” -which will make it easier to move to another blog engine such as Typo later-;) follow these additional steps:

  1. Download the Wordpress - Remove Index.php from Permalinks in IIS Plugin (scroll down), and install it into wordpress (upload to /wp-content/plugins/ folder, then Activate from Wordpress control panel).
  2. Change the default 404 error page of your IIS site. Most web hosting companies will offer a web form to accomplish this. At Crystaltech it looks like so:image
     Set the 404 error URL to “/index.php” or the root URL of you blog such as “/blog/index.php”. Then change the permalink structure to /%year%/%monthnum%/%day%/%postname%/.
    Hope it helps.
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

One Response to “Pretty Wordpress Permalinks on IIS Shared Hosting”

  1. SEO Tutorial Says:

    Thanks for this post! I thought I have no way for URL structure…. This post helps me a lot.

    Thanks again.

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in