GoDaddy 上 CodeIgniter 的 .htaccess 配置问题

.htaccess configuration issue with CodeIgniter on GoDaddy

我在使用 GoDaddy 上的 CodeIgniter(3.4 版)时遇到问题,在使用 ion_auth 通过登录门户正确实例化我的 default controller 后,找不到我的 sub-controllers .目前,我所有的网站文件都位于我的 GoDaddy 文件管理器

sub-folder

以下是我目前使用的配置...

.htaccess

Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/ [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.

如何使用 GoDaddy 正确配置 CodeIgniter?

尝试为您的子文件夹添加 RewriteBase,例如

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