TheAuzzieJesus
TheAuzzieJesus

Reputation: 607

.htaccess configuration issue with CodeIgniter on GoDaddy

I'm having issues with CodeIgniter (version 3.4) on GoDaddy where my sub-controllers are not being found after my default controller has been correctly instantiated through a login portal using ion_auth. Currently, all my website files are located within a sub-folder on my GoDaddy File Manager

Below are the configurations that I'm currently using...

.htaccess

Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

config.php

$path = "http://" . $_SERVER['HTTP_HOST'] . str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
$config['base_url'] = $path;
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

Before hosting on GoDaddy, I was using WAMP Server to host the website and had no issues whatsoever with this configuration.

What can I do to get CodeIgniter configured properly with GoDaddy?

Upvotes: 1

Views: 576

Answers (1)

Rohan Kumar
Rohan Kumar

Reputation: 40639

Try to add RewriteBase for your sub-folder like

RewriteEngine On
RewriteBase /subfolder/
....
....
RewriteRule . /subfolder/index.php [L]

Upvotes: 1

Related Questions