Skip to content

Commit

Permalink
Fixed issue: Trying to install on IIS results in a 404 error
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Nov 23, 2012
1 parent fbe8d29 commit e850e3c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion application/config/config-sample-mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
),
*/
'urlManager' => array(
'urlFormat' => 'path',
'urlFormat' => 'get',
'rules' => require('routes.php'),
'showScriptName' => true,
),
Expand Down
2 changes: 1 addition & 1 deletion application/config/config-sample-pgsql.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
// ),

'urlManager' => array(
'urlFormat' => 'path',
'urlFormat' => 'get',
'rules' => require('routes.php'),
'showScriptName' => true,
),
Expand Down
2 changes: 1 addition & 1 deletion application/config/config-sample-sqlsrv.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
// ),

'urlManager' => array(
'urlFormat' => 'path',
'urlFormat' => 'get',
'rules' => require('routes.php'),
'showScriptName' => true,
),
Expand Down
12 changes: 10 additions & 2 deletions application/controllers/InstallerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,15 @@ function _writeConfigFile()
//{
$showScriptName = 'true';
//}

if (stripos($_SERVER['SERVER_SOFTWARE'], 'apache') !== false)
{
$sURLFormat='path';
}
else
{
$sURLFormat='get'; // Fall back to get if an Apache server cannot be determined reliably
}

$dbdata = "<?php if (!defined('BASEPATH')) exit('No direct script access allowed');" . "\n"
."/*"."\n"
."| -------------------------------------------------------------------"."\n"
Expand Down Expand Up @@ -1016,7 +1024,7 @@ function _writeConfigFile()
*/

."\t\t" . "'urlManager' => array(" . "\n"
."\t\t\t" . "'urlFormat' => 'path'," . "\n"
."\t\t\t" . "'urlFormat' => '{$sURLFormat}'," . "\n"
."\t\t\t" . "'rules' => require('routes.php')," . "\n"
."\t\t\t" . "'showScriptName' => $showScriptName," . "\n"
."\t\t" . ")," . "\n"
Expand Down

0 comments on commit e850e3c

Please sign in to comment.