【发布时间】:2019-10-05 12:03:33
【问题描述】:
我有一个 web 应用的前端和后端,前端是在 codeigniter 框架中制作的,后端也是在另一个 codeigniter 框架中制作的。
前端:flum.com
后端:subdomain.flum.com
前端工作正常,但我在后端遇到了困难,它总是显示错误 404。
在我的共享主机文件管理器中,
前端 - codeigniter 应用程序 1
/root/username/application
/root/username/system
/root/username/public_html/index.php
/root/username/public_html/public/(css, js, images folders)
后端 - codeigniter 应用程序 2
/root/username/subdomain_application
/root/username/subdomain_system
/root/username/public_html/subdomain/index.php
/root/username/public_html/subdomain/public/(css, js, images folders)
两者具有相同的数据库设置 应用程序/config/database.php
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'user',
'password' => 'pass',
'database' => 'mydatabase',
'dbdriver' => 'mysqli',...
);
前端应用程序/config/config.php
$config['base_url'] = 'http://flum.com';
$config['index_page'] = '';
-我在主 ci 应用程序上编辑了 index.php
$system_path = '/root/username/application';
$application_folder = '/root/username/system';
后端应用程序/config/config.php
$config['base_url'] = 'http://subdomain.flum.com';
$config['index_page'] = '';
-我在主 ci 应用程序上编辑了 index.php
$system_path = '/root/username/subdomain_application';
$application_folder = '/root/username/subdomain_system';
两者都有相同的 .htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
鉴于后端位于一个完全独立的 codeigniter 应用程序中,我预计后端将与我的前端应用程序一起正常工作。
【问题讨论】:
标签: codeigniter subdomain hosting cpanel shared