Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Infinite Loops on posts and profiles with IIS


_ck_
Participant

@_ck_

I have a crazy idea to try to “fake out” bbPress and make it think request_uri actually exists on the IIS server so it doesn’t try to (incorrectly) calculate it itself.

Try saving and installing this as a plugin with a leading underscore, ie. _IIS-fix.php

<?php
/*
Plugin Name: IIS request_uri fix
*/
if (isset($_SERVER['HTTP_REQUEST_URI'])){
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_REQUEST_URI'];
}
else{
if(isset($_SERVER['SCRIPT_NAME']))
$_SERVER['HTTP_REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
else
$_SERVER['HTTP_REQUEST_URI'] = $_SERVER['PHP_SELF'];
if($_SERVER['QUERY_STRING']){
$_SERVER['HTTP_REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_REQUEST_URI'];
}
?>

no activation required, should auto-activate – just delete if it causes problems

Skip to toolbar