简体   繁体   English

从本地服务器上载Codeigniter网站到现场

[英]Uploading codeigniter site from local server to live

Hy every one, I made a site in codeigniter and its working fine on local server. 大家好,我在codeigniter中建立了一个站点,并且可以在本地服务器上正常工作。 I uploaded on live server: domain name ( http://fantastictravels.co/ ) and it says "This fantastictravels.co page can't be found" 我在实时服务器上上传了:域名( http://fantastictravels.co/ ),上面写着“找不到这个greattravels.co页面”

I tried many different things but its not working. 我尝试了很多不同的方法,但是没有用。 Here is my code of of view and controller: 这是我的视图和控制器代码:

controller: 控制器:

<?php

class Travels extends CI_Controller {

     function __construct(){
        parent :: __construct();
        $this->load->model('travel');
    }

    public function index()
    {

        $this->load->view('index');
    }
}

View: 视图:

<head>
    <meta http-equiv="Content-Language" content="en-us">
    <title></title>
    <meta charset="utf-8">
   </head>
<body>

    <div class="content">

       This is test
    </div>
</body>
</html>

In my config file, the base_url is " http://fantastictravels.co/ " and my all the files are located at the root directory of " http://fantastictravels.co/ ". 在我的配置文件中,base_url是“ http://fantastictravels.co/ ”,我的所有文件都位于“ http://fantastictravels.co/ ”的根目录下。 Help me out please. 请帮帮我。

1st, do you have a view file named index.php? 1,您是否有一个名为index.php的视图文件 Are your view files in the view folder? 您的视图文件是否在视图文件夹中?

Put this in your .htaccess file 把它放在你的.htaccess文件中

DirectoryIndex index.php
RewriteEngine on

RewriteCond $1 !^(index\.php|  (.*)\.swf|forums|images|css|downloads|js|robots\.txt|favicon\.ico)
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]

Go to your config file, and make sure this line looks like this 转到您的配置文件,并确保此行如下所示

$config['index_page'] = '';

我的控制器和模型文件名是小写字母,后来我变成大写字母,并且它变得固定了... :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM