Search code examples
apachecodeigniter-2

Why I am getting 'Forbidden' when I try to login on my live codeigniter site?


#Deny from all
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|assets|images|upload|uploads|html|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

This is my current .htaccess file and site is inside a sub-domain directory called clients. You can access the site here: http://clients.creditblitz.ca/


Solution

  • Your given url is redirect to 404 page

    http://clients.creditblitz.ca/authenticate

    But access below url redirect to 200 response

    http://clients.creditblitz.ca/index.php/authenticate

    So, Please remove the index.php in codeIgniter Framework config file

    $config['index_page'] = '';
    

    And apply below htaccess coding

    RewriteEngine ON
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^(index\.php|css|images|robots\.txt)
    RewriteRule .* index.php/$0 [PT,L]