<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ikailo &#187; IIS</title>
	<atom:link href="http://ikailo.com/tag/iis/feed/" rel="self" type="application/rss+xml" />
	<link>http://ikailo.com</link>
	<description>media solutions</description>
	<lastBuildDate>Fri, 04 Mar 2011 04:58:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>URL Mod-Rewrite Workaround for IIS 6.0 and WordPress</title>
		<link>http://ikailo.com/94/url-modrewrite-workaround-iis-60/</link>
		<comments>http://ikailo.com/94/url-modrewrite-workaround-iis-60/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 02:11:05 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[Mod-Rewrite]]></category>

		<guid isPermaLink="false">http://www.ikailo.com/?p=94</guid>
		<description><![CDATA[I found that the existing solution for using pretty permalinks with WordPress and IIS is good and lightweight, but I needed something a little more robust that fixed as many differences as possible between Apache and IIS. This code uses the same idea as the above, but fixes more values in _SERVER and resolves a [...]]]></description>
			<content:encoded><![CDATA[<p>I found that the existing solution for using <a title="Pretty Permalinks on WordPress and IIS" href="http://tech.einaregilsson.com/2007/07/30/pretty-wordpress-permalinks-on-iis/" target="_self">pretty permalinks with WordPress and IIS</a> is good and lightweight, but I needed something a little more robust that fixed as many differences as possible between Apache and IIS.</p>
<p>This code uses the same idea as the above, but fixes more values in _SERVER and resolves a problem with _GET. It will also work with later versions (2.8+) of WordPress.</p>
<pre class="brush: php; title: ;">&lt;?php
// This is the default file for the site. Usually index.php
$default = 'index.php';

// The name of this file.
// Set this value for the URL in Custom Error Properties of your website in IIS.
// Goto: IIS Manager &gt; Websites &gt; [Site Name] &gt; Properties &gt; Custom Errors &gt;
// 404 &amp; 404;2 &amp; 404;3 &gt; URL (Requires a '/' prefix in IIS).
$thisfile = '404-handler.php';

$_SERVER['ORIG_PATH_TRANSLATED'] = str_replace($thisfile, $default, $_SERVER['ORIG_PATH_TRANSLATED']);
$_SERVER['SCRIPT_FILENAME'] = str_replace($thisfile, $default, $_SERVER['SCRIPT_FILENAME']);
$_SERVER['ORIG_PATH_INFO'] = str_replace($thisfile, $default, $_SERVER['ORIG_PATH_INFO']);
$_SERVER['SCRIPT_NAME'] = str_replace($thisfile, $default, $_SERVER['SCRIPT_NAME']);
$_SERVER['PHP_SELF'] = str_replace($thisfile, $default, $_SERVER['PHP_SELF']);
$_SERVER['PATH_INFO'] = false;

$qs =&amp; $_SERVER['QUERY_STRING'];
$ru =&amp; $_SERVER['REQUEST_URI'];
$pos = strrpos($qs, '://');
$pos = strpos($qs, '/', $pos + 4);
$_SERVER['URL'] = $ru = substr($qs, $pos);
$qs = trim(stristr($ru, '?'), '?');

// Required for WordPress 2.8+
$_SERVER['HTTP_X_ORIGINAL_URL'] = $ru;

// Fix GET vars
foreach ( $_GET as $var =&gt; $val ) {
  if ( substr($var, 0, 3) == '404') {
    if ( strstr($var, '?') ) {
      $newvar = substr($var, strpos($var, '?') + 1);
      $_GET[$newvar] = $val;
    }
    unset($_GET[$var]);
  }
  break;
}
include($default);
?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://ikailo.com/94/url-modrewrite-workaround-iis-60/feed/</wfw:commentRss>
		<slash:comments>93</slash:comments>
		</item>
	</channel>
</rss>

