Welcome Guest, Not a member yet? Register   Sign In
403 Forbidden error on CI 2.1 installation
#1

[eluser]ksorbo[/eluser]
I am moving a working application to a new server and upgrading to 2.1 from 2.0.3

It is connecting to the db and logging, but when I attempt to go to any controllers, I get a 403 error.

All my folders are 755 and files 644.

I have E_All error level on with no visible PHP errors.

Running on Apache 2.2.17 (LiteSpeed)

Where do I look next?


My .htaccess is:
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /system/
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

My testing controller is:
Code:
&lt;?php
if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Welcome extends CI_Controller {

    function index(){
        echo 'hellow';
    }
    
}

I have debug turned on and this is what my log is showing:
Code:
DEBUG - 2012-01-22 22:05:29 --&gt; Config Class Initialized
DEBUG - 2012-01-22 22:05:29 --&gt; Hooks Class Initialized
DEBUG - 2012-01-22 22:05:29 --&gt; Utf8 Class Initialized
DEBUG - 2012-01-22 22:05:29 --&gt; UTF-8 Support Enabled
DEBUG - 2012-01-22 22:05:29 --&gt; URI Class Initialized
DEBUG - 2012-01-22 22:05:29 --&gt; Router Class Initialized
DEBUG - 2012-01-22 22:05:29 --&gt; No URI present. Default controller set.
DEBUG - 2012-01-22 22:05:29 --&gt; Output Class Initialized
DEBUG - 2012-01-22 22:05:29 --&gt; Security Class Initialized
DEBUG - 2012-01-22 22:05:29 --&gt; Input Class Initialized
DEBUG - 2012-01-22 22:05:29 --&gt; XSS Filtering completed
DEBUG - 2012-01-22 22:05:29 --&gt; XSS Filtering completed
DEBUG - 2012-01-22 22:05:29 --&gt; XSS Filtering completed
DEBUG - 2012-01-22 22:05:29 --&gt; XSS Filtering completed
DEBUG - 2012-01-22 22:05:29 --&gt; XSS Filtering completed
DEBUG - 2012-01-22 22:05:29 --&gt; Global POST and COOKIE data sanitized
DEBUG - 2012-01-22 22:05:29 --&gt; Language Class Initialized
DEBUG - 2012-01-22 22:05:29 --&gt; Loader Class Initialized
DEBUG - 2012-01-22 22:05:29 --&gt; Helper loaded: form_helper
DEBUG - 2012-01-22 22:05:29 --&gt; Helper loaded: url_helper
DEBUG - 2012-01-22 22:05:29 --&gt; Database Driver Class Initialized
DEBUG - 2012-01-22 22:05:29 --&gt; Session Class Initialized
DEBUG - 2012-01-22 22:05:29 --&gt; Helper loaded: string_helper
DEBUG - 2012-01-22 22:05:29 --&gt; Encrypt Class Initialized
DEBUG - 2012-01-22 22:05:29 --&gt; A session cookie was not found.
DEBUG - 2012-01-22 22:05:29 --&gt; Session routines successfully run
DEBUG - 2012-01-22 22:05:29 --&gt; Controller Class Initialized
DEBUG - 2012-01-22 22:05:29 --&gt; Model Class Initialized
DEBUG - 2012-01-22 22:05:29 --&gt; Model Class Initialized
#2

[eluser]CroNiX[/eluser]
It is because of your rewritebase in htaccess, /system/. If you look in the CI /system dir you will find an .htaccess preventing access.

Also, these lines are now obsolete (as system and application have their own htaccess preventing access by url):
Code:
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
    
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#3

[eluser]ksorbo[/eluser]
Thanks. That did the trick.




Theme © iAndrew 2016 - Forum software by © MyBB