Welcome Guest, Not a member yet? Register   Sign In
Apache 2.2.10 PHP 5.3.6 UBUNTU 11.10 and Codeigniter 2.1.0
#2

[eluser]Kyle Johnson[/eluser]
I just recently migrated my .htaccess files into the actual .conf for my site, so give this a shot and see if it helps.

Code:
ServerName example.com
DocumentRoot /var/www/public
<Directory /var/www/public>
DirectoryIndex index.php index.html
Options -Indexes +FollowSymLinks -MultiViews
AllowOverride None
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^$ index.php/ [QSA,L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule (.*) index.php?/$1 [QSA,L]
</IfModule>
Order allow,deny
Allow from all
</Directory>

I also had some issues with the base_url and the index file giving me trouble when I did a redirect, so I implemented the changes here:
Code:
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
| If this is not set then CodeIgniter will guess the protocol, domain and
| path to your installation.
|
*/
/* Detect ssl connectivity */
if ( isset($_SERVER['HTTPS']) )
$ssl = $_SERVER['HTTPS'];
elseif ( isset($_SERVER['HTTP_FRONT_END_HTTPS']) )
$ssl = $_SERVER['HTTP_FRONT_END_HTTPS'];
else
$ssl = "OFF";

$root = (stripos($ssl, "ON") !== FALSE) ? "https" : "http";

/* Many pages/apps served through the same domain */
if ( isset($_SERVER['HTTP_X_FORWARDED_HOST']) ) {
list($host) = explode(',', str_replace(' ', '', $_SERVER['HTTP_X_FORWARDED_HOST']));
} else {
$host = $_SERVER['HTTP_HOST'];
}

$root .= "://".$host;

if ( ! isset($_SERVER['ORIG_SCRIPT_NAME']) )
{
$root .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
}
else
{
$root .= str_replace(basename($_SERVER['ORIG_SCRIPT_NAME']),"",$_SERVER['ORIG_SCRIPT_NAME']);
}

$config['base_url'] = "$root";

/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = '';

Let me know if this works. I was going to make a 11.10 build last week, and now I'm glad I didn't.


Messages In This Thread
Apache 2.2.10 PHP 5.3.6 UBUNTU 11.10 and Codeigniter 2.1.0 - by El Forum - 02-18-2012, 12:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB