The specified CGI application misbehaved by not returning a complete set of HTTP headers

By default WordPress uses a query string to identify a post. This is neither search engine friendly nor human friendly. A better way is to use a custom URI to better identify your posts.

Default word press url structure: /?p=1

Customized post url can be as follows:
/index.php/2009/03/sample-post/
/index.php/archive/sample-post/

When you try to change default url of wordpress then you may got an error something like “The specified CGI application misbehaved by not returning a complete set of HTTP headers“.

This error generated because you change the default behaviour of url implementation on IIS for PHP and there were no extension to handle that request. PHP can process customized url but by default; it can not. You have to modify php.ini to use custom url.

Step 1: Generate new php.ini file and place it into your root directory.

Step 2: Modify newly generated php.ini and write following two lines.

cgi.fix_pathinfo = 1
cgi.force_redirect = 0

You’ll create new php.ini for each domain or sub domain that is using custom url structure or if you have access to modify php original ini file then you only modify that and you do not need to create new php.ini file for each domain or sub-domain.

Advertisements

2 thoughts on “The specified CGI application misbehaved by not returning a complete set of HTTP headers

  1. Kathleen says:

    My root directory doesn’t have a php.ini file and when I upload the above php.ini file into the root directory, I get this error message:

    Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

    So now what do I do?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s