Ok today I found a bug when doing postbacks with the IIS Friendly URLs. Here’s the fix:
1) Point both your custom 404 and 405 pages to the /index.php page
2) replace the above code with this one:
// IIS friendly url fix
if($this->config['friendly_urls']==1 && strpos($_SERVER['SERVER_SOFTWARE'],'Microsoft-IIS')!==false) {
$url = $_SERVER['QUERY_STRING'];
$err = substr($url,0,3);
if($err=='404'||$err=='405') {
$_SERVER['QUERY_STRING']=$qp['query'];
$qp = parse_url(str_replace($this->config['site_url'],'',substr($url,4)));
if(!empty($qp['query'])) {
parse_str($qp['query'],$qv);
foreach($qv as $n=>$v) $_REQUEST[$n]=$_GET[$n]=$v;
}
$_REQUEST['q'] = $_GET['q'] = $qp['path'];
}
}
Here’s also another solution for those who need true URL rewrite for IIS servers
http://www.isapirewrite.com