将CodeIgniter项目移动到实时服务器

时间:2017-06-15 06:26:18

标签: php codeigniter-3

我已经阅读过有关更改config.php和database.php的内容,但没有任何效果。 我已经使用重写删除了index.php,因此我的localhost和服务器都返回404错误(预期)。

我可以直接从网址= http://localhost/auth/login

打开来打开其他网页

但我收到错误'没有指定输入文件'在URL = http://nataliakiantoro.esy.es/auth/login

的实时服务器上

我在localhost中的文件夹路径,我使用wamp

WWW

-NK

- htaccess的

- 应用程序,系统,DLL

真实服务器中的文件夹路径

-public_html(我能得到的最外层,我认为这是根)

- htaccess的

-application,系统,DLL

'hostname' => 'mysql.idhostinger.com',
'username' => 'xxxxxx_admin',
'password' => 'xxxxxxx',
'database' => 'xxxxxxx_nk',

$config['base_url'] = 'http://www.nataliakiantoro.esy.es/';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|assets|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

我相信这是我调整和阅读的所有相关部分 我甚至创建了一个index.html并相应地更改了配置,但它仍然无法正常工作

我的本​​地php是5.5.12 live server php是5.6.21

所以我还没完成其他任何事情?

提前致谢

1 个答案:

答案 0 :(得分:0)

database.php
'hostname' => 'hostname',
'username' => 'xxxxxx_admin',
'password' => 'xxxxxxx',
'database' => 'xxxxxxx_nk',

config.php
$config['base_url'] = 'host_directory_path/project_folder_name';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';

.htaccess file put on root_directory 
RewriteEngine On
RewriteBase /project_Folder_name
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]