x
 
Create New Page

Revision: Workaround for Forced Query Strings

Revision from: 06:53, 4 Jun 2008

On some servers that run PHP as a CGI process and do not support the PATH_INFO server variable, this may allow you to run your site without forced query strings.

Open your index.php file and find the line:

$path_info = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO');

Replace it with:

$path_info = (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO');

If you are already using Forced Query Strings, remember to disable that option in your system preferences, and change the $qtype variable in the index.php back to ‘0’.

Users have reported that with GoDaddy Linux shared hosting, as well as BlueHost and Siteground, ORIG_PATH_INFO is supported.

This does not work on Verio’s shared servers as best as I can tell.

This has been confirmed as a fix on 1&1;Internet’s Shared Hosting Linux accounts.

NOTE- If you’re still having trouble on GoDaddy?  Check out this thread which laid out a way to avoid the 404/main page content on every page problem on GoDaddy- w/out forcing query strings.
.

On some servers where $_SERVER[‘PATH_INFO’] is not available, the variable $_SERVER[‘SCRIPT_NAME’] contains the needed information. In that case just replacing

$path_info = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] :
@
getenv('PATH_INFO');

with
$path_info = (isset($_SERVER['SCRIPT_NAME'])) ? $_SERVER['SCRIPT_NAME'] : @getenv('SCRIPT_NAME');

in your index.php-file fixes the problem.

Category:URLs

Categories: