Incorrect $_Server['REQUEST_URI'] on IIS7 FastCGI (2 posts)

  1. bobiasg
    Posted 7 years ago #

    I found incorrect $_SERVER[REQUEST_URI] on IIS7 using FastCGI.

    In IIS7 using FastCGI, $_SERVER[REQUEST_URI] is not empty, and value same $_SERVER['SCRIPT_NAME']. When I use a plugin, It request http://wstour/wp-admin/plugins.php?page=xxx, example: http://wstour/wp-admin/plugins.php?page=qtranslate-config. But, $_SERVER['RequestURI'] return http://wstour/wp-admin/plugins.php

    My computer:

    Vista Home Premium SP1
    IIS7.0 Fast CGI
    PHP 5.2.6 Non Thread safe
    Wordpress 2.5.1

  2. WebDev WaxLotus LLC
    Posted 7 years ago #

    Arrgh! Windows!

    Search google and you'll find several work-arounds for getting $_SERVER[REQUEST_URI] on IIS.

    Also, sometimes, the server throws an empty value:

    if (!isset($_SERVER['REQUEST_URI'])) {
    	$_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'],1);
    	if (isset($_SERVER['QUERY_STRING']) AND $_SERVER['QUERY_STRING'] != '') {

Topic Closed

This topic has been closed to new replies.

About this Topic